add fix for chinese language conversion

This commit is contained in:
Lars Kneschke 2004-02-26 06:42:20 +00:00
parent 5e73b0dc6c
commit c7daab6c2b

View File

@ -258,15 +258,18 @@
}
/*
php does not seem to support gb2312
but seems to be able to decode it as another charset
but seems to be able to decode it as EUC-CN
*/
if(strtolower($from) == 'gb2312')
switch(strtolower($from))
{
$from = mb_detect_encoding($data);
}
if(strtolower($from) == 'us-ascii')
{
$from = 'iso-8859-1';
case 'gb2312':
case 'gb18030':
$from = "EUC-CN";
break;
case 'us-ascii':
$from = 'iso-8859-1';
break;
}
if (!$to)
{