Explorar el Código

Fixed dates in copyright. added koi8-r and koi8-u decoding. fixed ereg in
utf-8 decoding.

tokul hace 22 años
padre
commit
79091d57db

+ 26 - 1
functions/decode/big5.php

@@ -4,11 +4,36 @@
  * decode/big5.php
  * decode/big5.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains big5 decoding function that is needed to read
  * This file contains big5 decoding function that is needed to read
  * big5 encoded mails in non-big5 locale.
  * big5 encoded mails in non-big5 locale.
+ * 
+ * Original data taken from:
+ *  ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT
+ *
+ * Name:             BIG5 to Unicode table (complete)
+ * Unicode version:  1.1
+ * Table version:    0.0d3
+ * Table format:     Format A
+ * Date:             11 February 1994
+ *
+ * Copyright (c) 1991-1994 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 magnetic media by Unicode, Inc., the sole
+ * remedy for any claim will be exchange of defective media within 90
+ * days of receipt.
+ *
+ * Recipient is granted the right to make copies in any form for
+ * internal distribution and to freely use the information supplied
+ * in the creation of products supporting Unicode.  Unicode, Inc.
+ * specifically excludes the right to re-distribute this file directly
+ * to third parties or other organizations whether for profit or not.
  *
  *
  */
  */
 
 

+ 1 - 1
functions/decode/cp1257.php

@@ -3,7 +3,7 @@
  * decode/cp1257.php
  * decode/cp1257.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains cp1257 decoding function that is needed to read
  * This file contains cp1257 decoding function that is needed to read

+ 1 - 1
functions/decode/gb2312.php

@@ -10,7 +10,7 @@
  * gb2313 encoded mails in non-gb2312 locale.
  * gb2313 encoded mails in non-gb2312 locale.
  * 
  * 
  * Original data taken from:
  * Original data taken from:
- *  ftp://ftp.unicode.org/Public/
+ *  ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/GB/GB2312.TXT
  *
  *
  *   Name:             GB2312-80 to Unicode table (complete, hex format)
  *   Name:             GB2312-80 to Unicode table (complete, hex format)
  *   Unicode version:  3.0
  *   Unicode version:  3.0

+ 1 - 1
functions/decode/iso8859-1.php

@@ -3,7 +3,7 @@
  * decode/iso8859-1.php
  * decode/iso8859-1.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-1 decoding function that is needed to read
  * This file contains iso-8859-1 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-10.php

@@ -3,7 +3,7 @@
  * decode/iso8859-10.php
  * decode/iso8859-10.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-10 decoding function that is needed to read
  * This file contains iso-8859-10 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-11.php

@@ -3,7 +3,7 @@
  * decode/iso8859-11.php
  * decode/iso8859-11.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-11 decoding function that is needed to read
  * This file contains iso-8859-11 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-13.php

@@ -3,7 +3,7 @@
  * decode/iso8859-13.php
  * decode/iso8859-13.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-13 decoding function that is needed to read
  * This file contains iso-8859-13 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-14.php

@@ -3,7 +3,7 @@
  * decode/iso8859-14.php
  * decode/iso8859-14.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-14 decoding function that is needed to read
  * This file contains iso-8859-14 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-15.php

@@ -3,7 +3,7 @@
  * decode/iso8859-15.php
  * decode/iso8859-15.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-15 decoding function that is needed to read
  * This file contains iso-8859-15 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-16.php

@@ -3,7 +3,7 @@
  * decode/iso8859-16.php
  * decode/iso8859-16.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-16 decoding function that is needed to read
  * This file contains iso-8859-16 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-2.php

@@ -3,7 +3,7 @@
  * decode/iso8859-2.php
  * decode/iso8859-2.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-2 decoding function that is needed to read
  * This file contains iso-8859-2 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-3.php

@@ -3,7 +3,7 @@
  * decode/iso8859-3.php
  * decode/iso8859-3.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-3 decoding function that is needed to read
  * This file contains iso-8859-3 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-4.php

@@ -3,7 +3,7 @@
  * decode/iso8859-4.php
  * decode/iso8859-4.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-4 decoding function that is needed to read
  * This file contains iso-8859-4 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-5.php

@@ -3,7 +3,7 @@
  * decode/iso8859-5.php
  * decode/iso8859-5.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-5 decoding function that is needed to read
  * This file contains iso-8859-5 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-6.php

@@ -3,7 +3,7 @@
  * decode/iso8859-6.php
  * decode/iso8859-6.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-6 decoding function that is needed to read
  * This file contains iso-8859-6 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-7.php

@@ -3,7 +3,7 @@
  * decode/iso8859-7.php
  * decode/iso8859-7.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-7 decoding function that is needed to read
  * This file contains iso-8859-7 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-8.php

@@ -3,7 +3,7 @@
  * decode/iso8859-8.php
  * decode/iso8859-8.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-8 decoding function that is needed to read
  * This file contains iso-8859-8 decoding function that is needed to read

+ 1 - 1
functions/decode/iso8859-9.php

@@ -3,7 +3,7 @@
  * decode/iso8859-9.php
  * decode/iso8859-9.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains iso-8859-9 decoding function that is needed to read
  * This file contains iso-8859-9 decoding function that is needed to read

+ 187 - 0
functions/decode/koi8-r.php

@@ -0,0 +1,187 @@
+<?php
+/*
+ * decode/koi8-r.php
+ * $Id$
+ *
+ * Copyright (c) 2003 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * This file contains koi8-r decoding function that is needed to read
+ * koi8-r encoded mails in non-koi8-r locale.
+ * 
+ * Original data taken from:
+ *  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT
+ *
+ * Name:             KOI8-R (RFC1489) to Unicode
+ * Unicode version:  3.0
+ * Table version:    1.0
+ * Table format:     Format A
+ * Date:             18 August 1999
+ * Authors:          Helmut Richter <richter@lrz.de>
+ *
+ * Copyright (c) 1991-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.
+ *
+ */
+
+function charset_decode_koi8r ($string) {
+    global $default_charset;
+
+    if (strtolower($default_charset) == 'koi8-r')
+        return $string;
+
+    /* Only do the slow convert if there are 8-bit characters */
+    /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
+    if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string) )
+        return $string;
+
+    $koi8r = array(
+	"\x80" => '&#9472;',
+	"\x81" => '&#9474;',
+	"\x82" => '&#9484;',
+	"\x83" => '&#9488;',
+	"\x84" => '&#9492;',
+	"\x85" => '&#9496;',
+	"\x86" => '&#9500;',
+	"\x87" => '&#9508;',
+	"\x88" => '&#9516;',
+	"\x89" => '&#9524;',
+	"\x8A" => '&#9532;',
+	"\x8B" => '&#9600;',
+	"\x8C" => '&#9604;',
+	"\x8D" => '&#9608;',
+	"\x8E" => '&#9612;',
+	"\x8F" => '&#9616;',
+	"\x90" => '&#9617;',
+	"\x91" => '&#9618;',
+	"\x92" => '&#9619;',
+	"\x93" => '&#8992;',
+	"\x94" => '&#9632;',
+	"\x95" => '&#8729;',
+	"\x96" => '&#8730;',
+	"\x97" => '&#8776;',
+	"\x98" => '&#8804;',
+	"\x99" => '&#8805;',
+	"\x9A" => '&#160;',
+	"\x9B" => '&#8993;',
+	"\x9C" => '&#176;',
+	"\x9D" => '&#178;',
+	"\x9E" => '&#183;',
+	"\x9F" => '&#247;',
+	"\xA0" => '&#9552;',
+	"\xA1" => '&#9553;',
+	"\xA2" => '&#9554;',
+	"\xA3" => '&#1105;',
+	"\xA4" => '&#9555;',
+	"\xA5" => '&#9556;',
+	"\xA6" => '&#9557;',
+	"\xA7" => '&#9558;',
+	"\xA8" => '&#9559;',
+	"\xA9" => '&#9560;',
+	"\xAA" => '&#9561;',
+	"\xAB" => '&#9562;',
+	"\xAC" => '&#9563;',
+	"\xAD" => '&#9564;',
+	"\xAE" => '&#9565;',
+	"\xAF" => '&#9566;',
+	"\xB0" => '&#9567;',
+	"\xB1" => '&#9568;',
+	"\xB2" => '&#9569;',
+	"\xB3" => '&#1025;',
+	"\xB4" => '&#9570;',
+	"\xB5" => '&#9571;',
+	"\xB6" => '&#9572;',
+	"\xB7" => '&#9573;',
+	"\xB8" => '&#9574;',
+	"\xB9" => '&#9575;',
+	"\xBA" => '&#9576;',
+	"\xBB" => '&#9577;',
+	"\xBC" => '&#9578;',
+	"\xBD" => '&#9579;',
+	"\xBE" => '&#9580;',
+	"\xBF" => '&#169;',
+	"\xC0" => '&#1102;',
+	"\xC1" => '&#1072;',
+	"\xC2" => '&#1073;',
+	"\xC3" => '&#1094;',
+	"\xC4" => '&#1076;',
+	"\xC5" => '&#1077;',
+	"\xC6" => '&#1092;',
+	"\xC7" => '&#1075;',
+	"\xC8" => '&#1093;',
+	"\xC9" => '&#1080;',
+	"\xCA" => '&#1081;',
+	"\xCB" => '&#1082;',
+	"\xCC" => '&#1083;',
+	"\xCD" => '&#1084;',
+	"\xCE" => '&#1085;',
+	"\xCF" => '&#1086;',
+	"\xD0" => '&#1087;',
+	"\xD1" => '&#1103;',
+	"\xD2" => '&#1088;',
+	"\xD3" => '&#1089;',
+	"\xD4" => '&#1090;',
+	"\xD5" => '&#1091;',
+	"\xD6" => '&#1078;',
+	"\xD7" => '&#1074;',
+	"\xD8" => '&#1100;',
+	"\xD9" => '&#1099;',
+	"\xDA" => '&#1079;',
+	"\xDB" => '&#1096;',
+	"\xDC" => '&#1101;',
+	"\xDD" => '&#1097;',
+	"\xDE" => '&#1095;',
+	"\xDF" => '&#1098;',
+	"\xE0" => '&#1070;',
+	"\xE1" => '&#1040;',
+	"\xE2" => '&#1041;',
+	"\xE3" => '&#1062;',
+	"\xE4" => '&#1044;',
+	"\xE5" => '&#1045;',
+	"\xE6" => '&#1060;',
+	"\xE7" => '&#1043;',
+	"\xE8" => '&#1061;',
+	"\xE9" => '&#1048;',
+	"\xEA" => '&#1049;',
+	"\xEB" => '&#1050;',
+	"\xEC" => '&#1051;',
+	"\xED" => '&#1052;',
+	"\xEE" => '&#1053;',
+	"\xEF" => '&#1054;',
+	"\xF0" => '&#1055;',
+	"\xF1" => '&#1071;',
+	"\xF2" => '&#1056;',
+	"\xF3" => '&#1057;',
+	"\xF4" => '&#1058;',
+	"\xF5" => '&#1059;',
+	"\xF6" => '&#1046;',
+	"\xF7" => '&#1042;',
+	"\xF8" => '&#1068;',
+	"\xF9" => '&#1067;',
+	"\xFA" => '&#1047;',
+	"\xFB" => '&#1064;',
+	"\xFC" => '&#1069;',
+	"\xFD" => '&#1065;',
+	"\xFE" => '&#1063;',
+	"\xFF" => '&#1066;'
+    );
+
+    $string = str_replace(array_keys($koi8r), array_values($koi8r), $string);
+
+    return $string;
+}
+
+?>

+ 190 - 0
functions/decode/koi8-u.php

@@ -0,0 +1,190 @@
+<?php
+/*
+ * decode/koi8-u.php
+ * $Id$
+ *
+ * Copyright (c) 2003 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * This file contains koi8-u decoding function that is needed to read
+ * koi8-u encoded mails in non-koi8-u locale.
+ * 
+ * Original data taken from rfc2319
+ *
+ * Original copyright:
+ *
+ * Copyright (C) The Internet Society (1998).  All Rights Reserved.
+ *
+ * This document and translations of it may be copied and furnished to
+ * others, and derivative works that comment on or otherwise explain it
+ * or assist in its implementation may be prepared, copied, published
+ * and distributed, in whole or in part, without restriction of any
+ * kind, provided that the above copyright notice and this paragraph are
+ * included on all such copies and derivative works.  However, this
+ * document itself may not be modified in any way, such as by removing
+ * the copyright notice or references to the Internet Society or other
+ * Internet organizations, except as needed for the purpose of
+ * developing Internet standards in which case the procedures for
+ * copyrights defined in the Internet Standards process must be
+ * followed, or as required to translate it into languages other than
+ * English.
+ *
+ * The limited permissions granted above are perpetual and will not be
+ * revoked by the Internet Society or its successors or assigns.
+ *
+ * This document and the information contained herein is provided on an
+ * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+function charset_decode_koi8u ($string) {
+    global $default_charset;
+
+    if (strtolower($default_charset) == 'koi8-u')
+        return $string;
+
+    /* Only do the slow convert if there are 8-bit characters */
+    /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
+    if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string) )
+        return $string;
+
+    $koi8u = array(
+	"\x80" => '&#9472;',
+	"\x81" => '&#9474;',
+	"\x82" => '&#9484;',
+	"\x83" => '&#9488;',
+	"\x84" => '&#9492;',
+	"\x85" => '&#9496;',
+	"\x86" => '&#9500;',
+	"\x87" => '&#9508;',
+	"\x88" => '&#9516;',
+	"\x89" => '&#9524;',
+	"\x8A" => '&#9532;',
+	"\x8B" => '&#9600;',
+	"\x8C" => '&#9604;',
+	"\x8D" => '&#9608;',
+	"\x8E" => '&#9612;',
+	"\x8F" => '&#9616;',
+	"\x90" => '&#9617;',
+	"\x91" => '&#9618;',
+	"\x92" => '&#9619;',
+	"\x93" => '&#8992;',
+	"\x94" => '&#9632;',
+	"\x95" => '&#8729;',
+	"\x96" => '&#8730;',
+	"\x97" => '&#8776;',
+	"\x98" => '&#8804;',
+	"\x99" => '&#8805;',
+	"\x9A" => '&#160;',
+	"\x9B" => '&#8993;',
+	"\x9C" => '&#176;',
+	"\x9D" => '&#178;',
+	"\x9E" => '&#183;',
+	"\x9F" => '&#247;',
+	"\xA0" => '&#9552;',
+	"\xA1" => '&#9553;',
+	"\xA2" => '&#9554;',
+	"\xA3" => '&#1105;',
+	"\xA4" => '&#1108;',
+	"\xA5" => '&#9556;',
+	"\xA6" => '&#1110;',
+	"\xA7" => '&#1111;',
+	"\xA8" => '&#9559;',
+	"\xA9" => '&#9560;',
+	"\xAA" => '&#9561;',
+	"\xAB" => '&#9562;',
+	"\xAC" => '&#9563;',
+	"\xAD" => '&#1169;',
+	"\xAE" => '&#9565;',
+	"\xAF" => '&#9566;',
+	"\xB0" => '&#9567;',
+	"\xB1" => '&#9568;',
+	"\xB2" => '&#9569;',
+	"\xB3" => '&#1025;',
+	"\xB4" => '&#1027;',
+	"\xB5" => '&#9571;',
+	"\xB6" => '&#1030;',
+	"\xB7" => '&#1031;',
+	"\xB8" => '&#9574;',
+	"\xB9" => '&#9575;',
+	"\xBA" => '&#9576;',
+	"\xBB" => '&#9577;',
+	"\xBC" => '&#9578;',
+	"\xBD" => '&#1168;',
+	"\xBE" => '&#9580;',
+	"\xBF" => '&#169;',
+	"\xC0" => '&#1102;',
+	"\xC1" => '&#1072;',
+	"\xC2" => '&#1073;',
+	"\xC3" => '&#1094;',
+	"\xC4" => '&#1076;',
+	"\xC5" => '&#1077;',
+	"\xC6" => '&#1092;',
+	"\xC7" => '&#1075;',
+	"\xC8" => '&#1093;',
+	"\xC9" => '&#1080;',
+	"\xCA" => '&#1081;',
+	"\xCB" => '&#1082;',
+	"\xCC" => '&#1083;',
+	"\xCD" => '&#1084;',
+	"\xCE" => '&#1085;',
+	"\xCF" => '&#1086;',
+	"\xD0" => '&#1087;',
+	"\xD1" => '&#1103;',
+	"\xD2" => '&#1088;',
+	"\xD3" => '&#1089;',
+	"\xD4" => '&#1090;',
+	"\xD5" => '&#1091;',
+	"\xD6" => '&#1078;',
+	"\xD7" => '&#1074;',
+	"\xD8" => '&#1100;',
+	"\xD9" => '&#1099;',
+	"\xDA" => '&#1079;',
+	"\xDB" => '&#1096;',
+	"\xDC" => '&#1101;',
+	"\xDD" => '&#1097;',
+	"\xDE" => '&#1095;',
+	"\xDF" => '&#1098;',
+	"\xE0" => '&#1070;',
+	"\xE1" => '&#1040;',
+	"\xE2" => '&#1041;',
+	"\xE3" => '&#1062;',
+	"\xE4" => '&#1044;',
+	"\xE5" => '&#1045;',
+	"\xE6" => '&#1060;',
+	"\xE7" => '&#1043;',
+	"\xE8" => '&#1061;',
+	"\xE9" => '&#1048;',
+	"\xEA" => '&#1049;',
+	"\xEB" => '&#1050;',
+	"\xEC" => '&#1051;',
+	"\xED" => '&#1052;',
+	"\xEE" => '&#1053;',
+	"\xEF" => '&#1054;',
+	"\xF0" => '&#1055;',
+	"\xF1" => '&#1071;',
+	"\xF2" => '&#1056;',
+	"\xF3" => '&#1057;',
+	"\xF4" => '&#1058;',
+	"\xF5" => '&#1059;',
+	"\xF6" => '&#1046;',
+	"\xF7" => '&#1042;',
+	"\xF8" => '&#1068;',
+	"\xF9" => '&#1067;',
+	"\xFA" => '&#1047;',
+	"\xFB" => '&#1064;',
+	"\xFC" => '&#1069;',
+	"\xFD" => '&#1065;',
+	"\xFE" => '&#1063;',
+	"\xFF" => '&#1066;'
+    );
+
+    $string = str_replace(array_keys($koi8u), array_values($koi8u), $string);
+
+    return $string;
+}
+
+?>

+ 4 - 5
functions/decode/utf-8.php

@@ -3,7 +3,7 @@
  * decode/utf-8.php
  * decode/utf-8.php
  * $Id$
  * $Id$
  *
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  *
  * This file contains utf-8 decoding function that is needed to read
  * This file contains utf-8 decoding function that is needed to read
@@ -19,15 +19,14 @@
  * 
  * 
  */
  */
 function charset_decode_utf8 ($string) {
 function charset_decode_utf8 ($string) {
-    global $default_charset, $languages, $sm_notAlias;
+  global $default_charset;
 
 
     if (strtolower($default_charset) == 'utf-8')
     if (strtolower($default_charset) == 'utf-8')
         return $string;
         return $string;
-    if (strtolower($languages[$sm_notAlias]['CHARSET']) == 'utf-8')
-        return $string;
 
 
     /* Only do the slow convert if there are 8-bit characters */
     /* Only do the slow convert if there are 8-bit characters */
-    if (! ereg("[\200-\377]", $string))
+    /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
+    if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string))
         return $string;
         return $string;
 
 
     // decode three byte unicode characters
     // decode three byte unicode characters