mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 05:16:30 +00:00
fixed Windows support
This commit is contained in:
@@ -100,7 +100,7 @@ class Twig_Environment
|
||||
), $options);
|
||||
|
||||
$this->debug = (bool) $options['debug'];
|
||||
$this->charset = strtoupper($options['charset']);
|
||||
$this->setCharset($options['charset']);
|
||||
$this->baseTemplateClass = $options['base_template_class'];
|
||||
$this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
|
||||
$this->strictVariables = (bool) $options['strict_variables'];
|
||||
@@ -604,7 +604,12 @@ class Twig_Environment
|
||||
*/
|
||||
public function setCharset($charset)
|
||||
{
|
||||
$this->charset = strtoupper($charset);
|
||||
if ('UTF8' === $charset = strtoupper($charset)) {
|
||||
// iconv on Windows requires "UTF-8" instead of "UTF8"
|
||||
$charset = 'UTF-8';
|
||||
}
|
||||
|
||||
$this->charset = $charset;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user