X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fdecode%2Fiso_ir_111.php;h=e7c9de83b8c303dbcf5c4b96090af411fdc6ff98;hb=10bf80c009d938fc0cf85a70d0a6b3834365b146;hp=cee5069c651f2dae10f5ac85602df799298342f6;hpb=df8c4d6d0d3ecbfd0bb64f52ab6db6708debbdba;p=squirrelmail.git diff --git a/functions/decode/iso_ir_111.php b/functions/decode/iso_ir_111.php index cee5069c..e7c9de83 100644 --- a/functions/decode/iso_ir_111.php +++ b/functions/decode/iso_ir_111.php @@ -1,37 +1,34 @@ * Date: 05 March 1998 * * Original copyright: * Copyright 1999 Computing Research Labs, New Mexico State University - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the ""Software""), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -40,6 +37,9 @@ * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * @copyright © 2003-2005 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package squirrelmail * @subpackage decode */ @@ -50,118 +50,111 @@ * @return string Decoded string */ function charset_decode_iso_ir_111 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-ir-111') - return $string; - - /* Only do the slow convert if there are 8-bit characters */ - /* there is no 0x80-0x9F letters in ISO-IR-111 */ - if ( ! ereg("[\241-\377]", $string) ) + // don't do decoding when there are no 8bit symbols + if (! sq_is8bit($string,'iso-ir-111')) return $string; $iso_ir_111 = 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($iso_ir_111), array_values($iso_ir_111), $string); return $string; } - -?> +?> \ No newline at end of file