* 0.9.6-DEV
+ * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII
* added a long-syntax for the set tag ({% set foo %}...{% endset %})
* unit tests are now powered by PHPUnit
* added support for gettext via the `i18n` extension
*/
public function tokenize($code, $filename = 'n/a')
{
+ if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2)
+ {
+ $mbEncoding = mb_internal_encoding();
+ mb_internal_encoding('ASCII');
+ }
+
$this->code = preg_replace('/(\r\n|\r|\n)/', "\n", $code);
$this->filename = $filename;
$this->cursor = 0;
$end = $token->getType() === Twig_Token::EOF_TYPE;
}
+ if (isset($mbEncoding))
+ {
+ mb_internal_encoding($mbEncoding);
+ }
+
return new Twig_TokenStream($tokens, $this->filename, $this->env->getTrimBlocks());
}