3cd3b4828f7af96280939de7f11410deacecab7c
5 * Copyright (c) 2003-2004 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 * This file contains iso-8859-9 decoding function that is needed to read
9 * iso-8859-9 encoded mails in non-iso-8859-9 locale.
11 * Original data taken from:
12 * ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-9.TXT
14 * Name: ISO/IEC 8859-9:1999 to Unicode
15 * Unicode version: 3.0
17 * Table format: Format A
19 * Authors: Ken Whistler <kenw@sybase.com>
22 * Copyright (c) 1999 Unicode, Inc. All Rights reserved.
24 * This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
25 * No claims are made as to fitness for any particular purpose. No
26 * warranties of any kind are expressed or implied. The recipient
27 * agrees to determine applicability of information provided. If this
28 * file has been provided on optical media by Unicode, Inc., the sole
29 * remedy for any claim will be exchange of defective media within 90
32 * Unicode, Inc. hereby grants the right to freely use the information
33 * supplied in this file in the creation of products supporting the
34 * Unicode Standard, and to make copies of this file in any form for
35 * internal or external distribution as long as this notice remains
39 * @package squirrelmail
44 * Decode iso8859-9 encoded strings
45 * @param string $string Encoded string
46 * @return string Decoded string
48 function charset_decode_iso_8859_9 ($string) {
49 global $default_charset;
51 if (strtolower($default_charset) == 'iso8859-9')
54 /* Only do the slow convert if there are 8-bit characters */
55 /* there is no 0x80-0x9F letters in ISO8859-* */
56 if ( ! ereg("[\241-\377]", $string) )
158 $string = str_replace(array_keys($iso8859_9), array_values($iso8859_9), $string);