X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fdecode%2Fiso_8859_14.php;h=50cd071849bc4fd956fddf3035f93e30c80a44e3;hb=24e8917ead46268f6a4264900c832b4a5c37ee84;hp=a76707dfb43633a137049c5280e73766ebdbe8ae;hpb=df8c4d6d0d3ecbfd0bb64f52ab6db6708debbdba;p=squirrelmail.git diff --git a/functions/decode/iso_8859_14.php b/functions/decode/iso_8859_14.php index a76707df..50cd0718 100644 --- a/functions/decode/iso_8859_14.php +++ b/functions/decode/iso_8859_14.php @@ -1,14 +1,11 @@ - * Ken Whistler + * Ken Whistler * * 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-2020 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package squirrelmail * @subpackage decode */ @@ -43,121 +44,113 @@ /** * Decode iso8859-14 encoded string * @param string $string Encoded string - * @return string $string Decoded string + * @return string $string Decoded string */ function charset_decode_iso_8859_14 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-14') - 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-14')) return $string; $iso8859_14 = 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($iso8869_14), array_values($iso8859_14), $string); + $string = str_replace(array_keys($iso8859_14), array_values($iso8859_14), $string); return $string; } - -?>