* 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)
return array('html');
}
-if (function_exists('iconv')) {
+if (function_exists('mb_convert_encoding')) {
function twig_convert_encoding($string, $to, $from)
{
- return iconv($from, $to, $string);
+ return mb_convert_encoding($string, $to, $from);
}
-} elseif (function_exists('mb_convert_encoding')) {
+} elseif (function_exists('iconv')) {
function twig_convert_encoding($string, $to, $from)
{
- return mb_convert_encoding($string, $to, $from);
+ return iconv($from, $to, $string);
}
} else {
function twig_convert_encoding($string, $to, $from)