X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fdecode%2Fiso_8859_7.php;h=3db20f5e9f51dd05174c286956d2dee22fb81d9e;hb=d8e94f0ae6733ca565035a93704d71de69b9f2e3;hp=350b559e51e262dd4207d2ae0196946396a8fb24;hpb=31841a9ece7cc2ae90bf52dd92db68142172a47b;p=squirrelmail.git diff --git a/functions/decode/iso_8859_7.php b/functions/decode/iso_8859_7.php index 350b559e..3db20f5e 100644 --- a/functions/decode/iso_8859_7.php +++ b/functions/decode/iso_8859_7.php @@ -1,13 +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-2009 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail * @subpackage decode @@ -46,112 +46,104 @@ * @return string $string Decoded string */ function charset_decode_iso_8859_7 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-7') - 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-7')) return $string; $iso8859_7 = array( - "\xA0" => ' ', - "\xA1" => '‘', - "\xA2" => '’', - "\xA3" => '£', - "\xA6" => '¦', - "\xA7" => '§', - "\xA8" => '¨', - "\xA9" => '©', - "\xAB" => '«', - "\xAC" => '¬', - "\xAD" => '­', - "\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" => 'Ρ', - "\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" => 'ώ' + "\xA0" => ' ', + "\xA1" => '‘', + "\xA2" => '’', + "\xA3" => '£', + "\xA6" => '¦', + "\xA7" => '§', + "\xA8" => '¨', + "\xA9" => '©', + "\xAB" => '«', + "\xAC" => '¬', + "\xAD" => '­', + "\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" => 'Ρ', + "\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" => 'ώ' ); $string = str_replace(array_keys($iso8859_7), array_values($iso8859_7), $string); return $string; } - -?>