mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- PHP4's mbstring is stupid stupid stupid
git-svn-id: file:///svn/phpbb/trunk@7008 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5c6653717f
commit
0350eb9f3c
1 changed files with 20 additions and 4 deletions
|
@ -728,11 +728,27 @@ function utf8_recode($string, $encoding)
|
||||||
// Try the mb_string extension
|
// Try the mb_string extension
|
||||||
if (function_exists('mb_convert_encoding'))
|
if (function_exists('mb_convert_encoding'))
|
||||||
{
|
{
|
||||||
$ret = @mb_convert_encoding($string, 'utf-8', $encoding);
|
// mbstring is nasty on PHP4, we must make *sure* that we send a good encoding
|
||||||
|
switch ($encoding)
|
||||||
if (!empty($ret))
|
|
||||||
{
|
{
|
||||||
return $ret;
|
case 'iso-8859-1':
|
||||||
|
case 'iso-8859-2':
|
||||||
|
case 'iso-8859-4':
|
||||||
|
case 'iso-8859-7':
|
||||||
|
case 'iso-8859-9':
|
||||||
|
case 'iso-8859-15':
|
||||||
|
case 'windows-1251':
|
||||||
|
case 'windows-1252':
|
||||||
|
case 'shift_jis':
|
||||||
|
case 'euc-kr':
|
||||||
|
case 'big5':
|
||||||
|
case 'gb2312':
|
||||||
|
$ret = @mb_convert_encoding($string, 'utf-8', $encoding);
|
||||||
|
|
||||||
|
if (!empty($ret))
|
||||||
|
{
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue