protected function fixCharset($string)
    {
        if ('UTF-8' !== $this->getCharset()) {
            $string = mb_convert_encoding($string, $this->getCharset(), 'UTF-8');
        }

        return $string;
    }
protected function fixCharset($string)
    {
        if ('UTF-8' !== $this->getCharset()) {
            $string = mb_convert_encoding($string, $this->getCharset(), 'UTF-8');
        }

        return $string;
    }
protected function fixCharset ( $ string ) { if ( 'UTF-8' !== $ this -> getCharset ( ) ) { $ string = mb_convert_encoding ( $ string , $ this -> getCharset ( ) , 'UTF-8' ) ; } return $ string ; }
Fixes the charset by converting a string from an UTF-8 charset to the
charset of the kernel.

Precondition: the kernel charset is not UTF-8

@param string $string The string to fix

@return string A string with the %kernel.charset% encoding
Fixes the charset by converting a string from an UTF - 8 charset to the charset of the kernel .