Example #1
0
/**
 * @param string $str
 *
 * @return string
 */
function utf8_decode($str)
{
    return s\Xml::utf8_decode($str);
}
Example #2
0
File: UTF8.php Project: hhgr/hhgolf
 /**
  * utf8 - decode
  *
  * @param string $string
  *
  * @return string
  */
 public static function utf8_decode($string)
 {
     static $utf8ToWin1252Keys = null;
     static $utf8ToWin1252Values = null;
     $string = (string) $string;
     if (!isset($string[0])) {
         return '';
     }
     // init
     self::checkForSupport();
     $string = self::to_utf8($string);
     if ($utf8ToWin1252Keys === null) {
         $utf8ToWin1252Keys = array_keys(self::$utf8ToWin1252);
         $utf8ToWin1252Values = array_values(self::$utf8ToWin1252);
     }
     return Xml::utf8_decode(str_replace($utf8ToWin1252Keys, $utf8ToWin1252Values, $string));
 }