cvs: php-news-web / common.inc

From: Date: Thu, 12 Sep 2002 03:02:29 +0000
Subject: cvs: php-news-web / common.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-12488@lists.php.net to get a copy of this message
wez Wed Sep 11 23:02:29 2002 EDT Modified files: /php-news-web common.inc Log: Only use iconv, and be robust in the case that iconv fails. Index: php-news-web/common.inc diff -u php-news-web/common.inc:1.17 php-news-web/common.inc:1.18 --- php-news-web/common.inc:1.17 Wed Sep 11 07:17:52 2002 +++ php-news-web/common.inc Wed Sep 11 23:02:29 2002 @@ -66,6 +66,15 @@ <?php } + function to_utf8($str, $charset) + { + $n = iconv(strlen($charset) ? $charset : "iso-8859-1", "utf-8", $str); + if ($n === false) + return $str; + return $n; + } + +/* if (function_exists("mb_convert_encoding")) { function to_utf8($str, $charset) { @@ -89,6 +98,7 @@ return $str; } } +*/ function decode_header($charset,$encoding,$text) { if (strtolower($encoding) == "b") {

« previous php.mirrors (#12488) next »