예제 #1
0
function utf8_convert($string)
{
  global $windows_locale, $unicode_encoding, $winlocale_codepage_map;

  if ($unicode_encoding && (get_server_os() == "windows") && $windows_locale)
  {
    if ($winlocale_codepage_map[$windows_locale])
    {
      $string = iconv($winlocale_codepage_map[$windows_locale],"utf-8",$string);
    }
  }
  return $string;
}
예제 #2
0
/**
 * @param string $string
 */
function utf8_convert($string)
{
    global $windows_locale, $unicode_encoding, $winlocale_codepage_map;
    if ($unicode_encoding && get_server_os() == 'windows' && $windows_locale) {
        if ($winlocale_codepage_map[$windows_locale]) {
            $string = iconv($winlocale_codepage_map[$windows_locale], 'utf-8', $string);
        }
    }
    if (!test_utf8($string)) {
        return utf8_encode($string);
    } else {
        return $string;
    }
}