switched to use mbstring whenever possible instead of iconv (because of issues with iconv and Japanese -- thanks @ganchiku for the tip)

This commit is contained in:
Fabien Potencier
2012-05-05 08:28:23 +02:00
parent f8e9a45388
commit d661c2a2f6
2 changed files with 7 additions and 6 deletions
+1
View File
@@ -4,6 +4,7 @@
* 1.8.0 (2012-05-08)
* switched to use mbstring whenever possible instead of iconv
* enforced interface when adding tests, filters, functions, and node visitors from extensions
* fixed a side-effect of the date filter where the timezone might be changed
* simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer)
+6 -6
View File
@@ -825,16 +825,16 @@ function twig_escape_filter_is_safe(Twig_Node $filterArgs)
return array('html');
}
if (function_exists('iconv')) {
function twig_convert_encoding($string, $to, $from)
{
return iconv($from, $to, $string);
}
} elseif (function_exists('mb_convert_encoding')) {
if (function_exists('mb_convert_encoding')) {
function twig_convert_encoding($string, $to, $from)
{
return mb_convert_encoding($string, $to, $from);
}
} elseif (function_exists('iconv')) {
function twig_convert_encoding($string, $to, $from)
{
return iconv($from, $to, $string);
}
} else {
function twig_convert_encoding($string, $to, $from)
{