From: garvinhicking Date: Sat, 5 Aug 2006 20:59:20 +0000 (+0000) Subject: Fix iconv bug, thanks to Matthias Leise X-Git-Tag: 1.0.1~8 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=64af0896fa68ed02a731d739a96a1f1855aad709;p=s9y.git Fix iconv bug, thanks to Matthias Leise --- diff --git a/docs/NEWS b/docs/NEWS index 66d141a..088f795 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ 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 282ccf5..b671b31 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -480,7 +480,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 {