예제 #1
0
 /**
  * Attempt to set locale to UTF-8
  *
  * @return void
  */
 protected static function setLocaleToUTF8()
 {
     if (!self::$isLocaleSet && preg_match('/(([^_]+)_?([^.]*))\\.?(.*)?/', setlocale(LC_TIME, 0), $match) && !preg_match('/utf\\-?8/i', $match[4])) {
         $lng = \XLite\Core\Session::getInstance()->getLanguage();
         $localeCode = $lng->getCode() . '_' . strtoupper($lng->getCode());
         $localeCode3 = $lng->getCode3();
         setlocale(LC_TIME, $localeCode . '.UTF-8', $localeCode, $lng->getCode(), $localeCode3, $match[0]);
         self::$isLocaleSet = true;
     }
 }
예제 #2
0
파일: Converter.php 프로젝트: kingsj/core
 /**
  * Attempt to set locale to UTF-8
  *
  * @return void
  */
 protected static function setLocaleToUTF8()
 {
     if (!self::$isLocaleSet && preg_match('/(([^_]+)_?([^.]*))\\.?(.*)?/', setlocale(LC_TIME, 0), $match) && !preg_match('/utf\\-?8/i', $match[4])) {
         setlocale(LC_TIME, $match[1] . '.UTF8', $match[1] . '.UTF-8', 'en_US.UTF8', 'en_US.UTF-8', 'en_US', 'ENG', 'English', $match[0]);
         self::$isLocaleSet = true;
     }
 }