Twig_Environment::setCharset PHP Method

setCharset() public method

public setCharset ( $charset )
    public function setCharset($charset)
    {
        $this->charset = $charset;
    }

Same methods

Twig_Environment::setCharset ( string $charset )

Usage Example

Example #1
0
 public function testReverseFilterOnNonUTF8String()
 {
     $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
     $twig->setCharset('ISO-8859-1');
     $input = iconv('UTF-8', 'ISO-8859-1', 'Äé');
     $output = iconv('ISO-8859-1', 'UTF-8', twig_reverse_filter($twig, $input));
     $this->assertEquals($output, 'éÄ');
 }
All Usage Examples Of Twig_Environment::setCharset