--- functions/i18n.php-orig Wed Oct 1 19:33:15 2003 +++ functions/i18n.php Tue May 11 20:34:00 2004 @@ -56,11 +56,15 @@ } } else if ($charset == 'ns_4551-1') { $ret = charset_decode_ns_4551_1 ($string); - } else if ($charset == 'koi8-r') { +// } else if ($charset == 'koi8-r') { + } else if (($charset == 'koi8-r') or ($charset == 'koi8-ru') or ($charset == 'koi8r') or + ($charset == 'koi8') or ($charset == 'cskoi8r')) { $ret = charset_decode_koi8r ($string); - } else if ($charset == 'koi8-u') { +// } else if ($charset == 'koi8-u') { + } else if (($charset == 'koi8-u') or ($charset == 'koi8-ua')) { $ret = charset_decode_koi8u ($string); - } else if ($charset == 'windows-1251') { +// } else if ($charset == 'windows-1251') { + } else if (($charset == 'windows-1251') or ($charset == 'cp1251')) { $ret = charset_decode_windows_1251 ($string); } else if ($charset == 'windows-1253') { $ret = charset_decode_windows_1253 ($string); @@ -70,6 +74,11 @@ $ret = charset_decode_windows_1257 ($string); } else if ($charset == 'utf-8') { $ret = charset_decode_utf8 ($string); + } else if (($charset == '866') or ($charset == 'cp866') or ($charset == 'cp-866') or + ($charset == 'x-cp866') or ($charset == 'csibm866') or ($charset == 'ibm866')) { + $ret = charset_decode_cp866 ($string); + } else if (($charset == 'x-mac-cyrillic') or ($charset == 'maccyrillic') or ($charset == 'mac-cyrillic')) { + $ret = charset_decode_mac ($string); } else { $ret = $string; } @@ -1178,6 +1187,20 @@ $string = str_replace("\377", 'Ъ', $string); return $string; +} + +/* cp-866 is DOS Cyrillic encoding */ +function charset_decode_cp866 ($string) { + // Convert to windows-1251, then return this decoded. + $string = convert_cyr_string($string, 'a', 'w'); + return charset_decode_windows_1251($string); +} + +/* x-mac-cyrillic is Macithosh Cyrillic encoding */ +function charset_decode_mac ($string) { + // Convert to windows-1251, then return this decoded. + $string = convert_cyr_string($string, 'm', 'w'); + return charset_decode_windows_1251($string); } /*