mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-02 21:46:48 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user