123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?php
- /**
- * decode/iso8859-8.php
- *
- * This file contains iso-8859-8 decoding function that is needed to read
- * iso-8859-8 encoded mails in non-iso-8859-8 locale.
- *
- * Original data taken from:
- * ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-8.TXT
- *
- * Name: ISO/IEC 8859-8:1999 to Unicode
- * Unicode version: 3.0
- * Table version: 1.1
- * Table format: Format A
- * Date: 2000-Jan-03
- * Authors: Ken Whistler <kenw@sybase.com>
- *
- * Original copyright:
- * 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.
- *
- * 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-2006 The SquirrelMail Project Team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @version $Id$
- * @package squirrelmail
- * @subpackage decode
- */
- /**
- * Decode iso8859-8 encoded strings
- * @param string $string Encoded string
- * @return string $string Decoded string
- */
- function charset_decode_iso_8859_8 ($string) {
- // don't do decoding when there are no 8bit symbols
- if (! sq_is8bit($string,'iso-8859-8'))
- return $string;
- $iso8859_8 = array(
- "\xA0" => ' ',
- "\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" => '¾',
- "\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" => 'ת',
- "\xFD" => '‎',
- "\xFE" => '‏'
- );
- $string = str_replace(array_keys($iso8859_8), array_values($iso8859_8), $string);
- return $string;
- }
|