From: garvinhicking Date: Sat, 5 Aug 2006 20:59:00 +0000 (+0000) Subject: Fix iconv bug, thanks to Matthias Leise X-Git-Tag: 1.1~151 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d9b2babfb1e3bb997b3ec61d5e5123904f3f1b35;p=s9y.git Fix iconv bug, thanks to Matthias Leise --- diff --git a/docs/NEWS b/docs/NEWS index dfce7e2..be26179 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -241,6 +241,9 @@ Version 1.1-alpha5() Version 1.0.1 () ------------------------------------------------------------------------ + * Fix utf8 iconv conversion failing on some older PHP setups. + Thanks to Matthias Leisi! + * Fix multi-authors view only showing first author (garvinhicking) * Fix bug sending comment-notification mails to subscribed users diff --git a/include/functions.inc.php b/include/functions.inc.php index 772ae7b..c0d634e 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -537,7 +537,12 @@ function serendipity_fetchReferences($id) { function serendipity_utf8_encode($string) { if (strtolower(LANG_CHARSET) != 'utf-8') { if (function_exists('iconv')) { - return iconv(LANG_CHARSET, 'UTF-8', $string); + $new = iconv(LANG_CHARSET, 'UTF-8', $string); + if ($new !== false) { + return $new; + } else { + return utf8_encode($string); + } } else if (function_exists('mb_convert_encoding')) { return mb_convert_encoding($string, 'UTF-8', LANG_CHARSET); } else {