switched to use mbstring whenever possible instead of iconv
This commit is contained in:
parent
dd0da03c8c
commit
e193452742
@ -507,10 +507,10 @@ class PhpEngine implements EngineInterface, \ArrayAccess
|
||||
*/
|
||||
public function convertEncoding($string, $to, $from)
|
||||
{
|
||||
if (function_exists('iconv')) {
|
||||
return iconv($from, $to, $string);
|
||||
} elseif (function_exists('mb_convert_encoding')) {
|
||||
if (function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($string, $to, $from);
|
||||
} elseif (function_exists('iconv')) {
|
||||
return iconv($from, $to, $string);
|
||||
}
|
||||
|
||||
throw new \RuntimeException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).');
|
||||
|
@ -134,10 +134,10 @@ class Unescaper
|
||||
*/
|
||||
private function convertEncoding($value, $to, $from)
|
||||
{
|
||||
if (function_exists('iconv')) {
|
||||
return iconv($from, $to, $value);
|
||||
} elseif (function_exists('mb_convert_encoding')) {
|
||||
if (function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($value, $to, $from);
|
||||
} elseif (function_exists('iconv')) {
|
||||
return iconv($from, $to, $value);
|
||||
}
|
||||
|
||||
throw new \RuntimeException('No suitable convert encoding function (install the iconv or mbstring extension).');
|
||||
|
Reference in New Issue
Block a user