SebastianBergmann\PHPCPD\Log\AbstractXmlLogger::convertToUtf8 PHP 메소드

convertToUtf8() 보호된 메소드

Converts a string to UTF-8 encoding.
protected convertToUtf8 ( string $string ) : string
$string string
리턴 string
    protected function convertToUtf8($string)
    {
        if (!$this->isUtf8($string)) {
            if (function_exists('mb_convert_encoding')) {
                $string = mb_convert_encoding($string, 'UTF-8');
            } else {
                $string = utf8_encode($string);
            }
        }
        return $string;
    }