X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=functions%2Fdecode%2Fiso_8859_5.php;h=d9d78c8058aacb359fbf8ba1c07b1f3875e519b2;hb=ae5dddc065f9501f267c4edaf68a066835da915f;hp=bf4fea41cab718a2b1edd7e6892cbf12afecb66e;hpb=82d304a0501324b276cabab1870755d5352bd21c;p=squirrelmail.git diff --git a/functions/decode/iso_8859_5.php b/functions/decode/iso_8859_5.php index bf4fea41..d9d78c80 100644 --- a/functions/decode/iso_8859_5.php +++ b/functions/decode/iso_8859_5.php @@ -1,14 +1,11 @@ * * Original copyright: - * Copyright (c) 1999 Unicode, Inc. All Rights reserved. + * Copyright (c) 1999 Unicode, Inc. All Rights reserved. + * + * This file is provided as-is by Unicode, Inc. (The Unicode Consortium). + * No claims are made as to fitness for any particular purpose. No + * warranties of any kind are expressed or implied. The recipient + * agrees to determine applicability of information provided. If this + * file has been provided on optical media by Unicode, Inc., the sole + * remedy for any claim will be exchange of defective media within 90 + * days of receipt. * - * This file is provided as-is by Unicode, Inc. (The Unicode Consortium). - * No claims are made as to fitness for any particular purpose. No - * warranties of any kind are expressed or implied. The recipient - * agrees to determine applicability of information provided. If this - * file has been provided on optical media by Unicode, Inc., the sole - * remedy for any claim will be exchange of defective media within 90 - * days of receipt. + * Unicode, Inc. hereby grants the right to freely use the information + * supplied in this file in the creation of products supporting the + * Unicode Standard, and to make copies of this file in any form for + * internal or external distribution as long as this notice remains + * attached. * - * Unicode, Inc. hereby grants the right to freely use the information - * supplied in this file in the creation of products supporting the - * Unicode Standard, and to make copies of this file in any form for - * internal or external distribution as long as this notice remains - * attached. + * @copyright 2003-2011 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package squirrelmail * @subpackage decode */ @@ -45,118 +46,110 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_5 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-5') - return $string; - - /* Only do the slow convert if there are 8-bit characters */ - /* there is no 0x80-0x9F letters in ISO8859-* */ - if ( ! ereg("[\241-\377]", $string) ) + // don't do decoding when there are no 8bit symbols + if (! sq_is8bit($string,'iso-8859-5')) return $string; $iso8859_5 = array( - "\xA0" => ' ', - "\xA1" => 'Ё', - "\xA2" => 'Ђ', - "\xA3" => 'Ѓ', - "\xA4" => 'Є', - "\xA5" => 'Ѕ', - "\xA6" => 'І', - "\xA7" => 'Ї', - "\xA8" => 'Ј', - "\xA9" => 'Љ', - "\xAA" => 'Њ', - "\xAB" => 'Ћ', - "\xAC" => 'Ќ', - "\xAD" => '­', - "\xAE" => 'Ў', - "\xAF" => 'Џ', - "\xB0" => 'А', - "\xB1" => 'Б', - "\xB2" => 'В', - "\xB3" => 'Г', - "\xB4" => 'Д', - "\xB5" => 'Е', - "\xB6" => 'Ж', - "\xB7" => 'З', - "\xB8" => 'И', - "\xB9" => 'Й', - "\xBA" => 'К', - "\xBB" => 'Л', - "\xBC" => 'М', - "\xBD" => 'Н', - "\xBE" => 'О', - "\xBF" => 'П', - "\xC0" => 'Р', - "\xC1" => 'С', - "\xC2" => 'Т', - "\xC3" => 'У', - "\xC4" => 'Ф', - "\xC5" => 'Х', - "\xC6" => 'Ц', - "\xC7" => 'Ч', - "\xC8" => 'Ш', - "\xC9" => 'Щ', - "\xCA" => 'Ъ', - "\xCB" => 'Ы', - "\xCC" => 'Ь', - "\xCD" => 'Э', - "\xCE" => 'Ю', - "\xCF" => 'Я', - "\xD0" => 'а', - "\xD1" => 'б', - "\xD2" => 'в', - "\xD3" => 'г', - "\xD4" => 'д', - "\xD5" => 'е', - "\xD6" => 'ж', - "\xD7" => 'з', - "\xD8" => 'и', - "\xD9" => 'й', - "\xDA" => 'к', - "\xDB" => 'л', - "\xDC" => 'м', - "\xDD" => 'н', - "\xDE" => 'о', - "\xDF" => 'п', - "\xE0" => 'р', - "\xE1" => 'с', - "\xE2" => 'т', - "\xE3" => 'у', - "\xE4" => 'ф', - "\xE5" => 'х', - "\xE6" => 'ц', - "\xE7" => 'ч', - "\xE8" => 'ш', - "\xE9" => 'щ', - "\xEA" => 'ъ', - "\xEB" => 'ы', - "\xEC" => 'ь', - "\xED" => 'э', - "\xEE" => 'ю', - "\xEF" => 'я', - "\xF0" => '№', - "\xF1" => 'ё', - "\xF2" => 'ђ', - "\xF3" => 'ѓ', - "\xF4" => 'є', - "\xF5" => 'ѕ', - "\xF6" => 'і', - "\xF7" => 'ї', - "\xF8" => 'ј', - "\xF9" => 'љ', - "\xFA" => 'њ', - "\xFB" => 'ћ', - "\xFC" => 'ќ', - "\xFD" => '§', - "\xFE" => 'ў', - "\xFF" => 'џ' + "\xA0" => ' ', + "\xA1" => 'Ё', + "\xA2" => 'Ђ', + "\xA3" => 'Ѓ', + "\xA4" => 'Є', + "\xA5" => 'Ѕ', + "\xA6" => 'І', + "\xA7" => 'Ї', + "\xA8" => 'Ј', + "\xA9" => 'Љ', + "\xAA" => 'Њ', + "\xAB" => 'Ћ', + "\xAC" => 'Ќ', + "\xAD" => '­', + "\xAE" => 'Ў', + "\xAF" => 'Џ', + "\xB0" => 'А', + "\xB1" => 'Б', + "\xB2" => 'В', + "\xB3" => 'Г', + "\xB4" => 'Д', + "\xB5" => 'Е', + "\xB6" => 'Ж', + "\xB7" => 'З', + "\xB8" => 'И', + "\xB9" => 'Й', + "\xBA" => 'К', + "\xBB" => 'Л', + "\xBC" => 'М', + "\xBD" => 'Н', + "\xBE" => 'О', + "\xBF" => 'П', + "\xC0" => 'Р', + "\xC1" => 'С', + "\xC2" => 'Т', + "\xC3" => 'У', + "\xC4" => 'Ф', + "\xC5" => 'Х', + "\xC6" => 'Ц', + "\xC7" => 'Ч', + "\xC8" => 'Ш', + "\xC9" => 'Щ', + "\xCA" => 'Ъ', + "\xCB" => 'Ы', + "\xCC" => 'Ь', + "\xCD" => 'Э', + "\xCE" => 'Ю', + "\xCF" => 'Я', + "\xD0" => 'а', + "\xD1" => 'б', + "\xD2" => 'в', + "\xD3" => 'г', + "\xD4" => 'д', + "\xD5" => 'е', + "\xD6" => 'ж', + "\xD7" => 'з', + "\xD8" => 'и', + "\xD9" => 'й', + "\xDA" => 'к', + "\xDB" => 'л', + "\xDC" => 'м', + "\xDD" => 'н', + "\xDE" => 'о', + "\xDF" => 'п', + "\xE0" => 'р', + "\xE1" => 'с', + "\xE2" => 'т', + "\xE3" => 'у', + "\xE4" => 'ф', + "\xE5" => 'х', + "\xE6" => 'ц', + "\xE7" => 'ч', + "\xE8" => 'ш', + "\xE9" => 'щ', + "\xEA" => 'ъ', + "\xEB" => 'ы', + "\xEC" => 'ь', + "\xED" => 'э', + "\xEE" => 'ю', + "\xEF" => 'я', + "\xF0" => '№', + "\xF1" => 'ё', + "\xF2" => 'ђ', + "\xF3" => 'ѓ', + "\xF4" => 'є', + "\xF5" => 'ѕ', + "\xF6" => 'і', + "\xF7" => 'ї', + "\xF8" => 'ј', + "\xF9" => 'љ', + "\xFA" => 'њ', + "\xFB" => 'ћ', + "\xFC" => 'ќ', + "\xFD" => '§', + "\xFE" => 'ў', + "\xFF" => 'џ' ); $string = str_replace(array_keys($iso8859_5), array_values($iso8859_5), $string); return $string; } - -?>