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