* decode/big5.php
* $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.
*
* This file contains big5 decoding function that is needed to read
* 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.
*
*/
* decode/cp1257.php
* $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.
*
* This file contains cp1257 decoding function that is needed to read
* gb2313 encoded mails in non-gb2312 locale.
*
* 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)
* Unicode version: 3.0
* decode/iso8859-1.php
* $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.
*
* This file contains iso-8859-1 decoding function that is needed to read
* decode/iso8859-10.php
* $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.
*
* This file contains iso-8859-10 decoding function that is needed to read
* decode/iso8859-11.php
* $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.
*
* This file contains iso-8859-11 decoding function that is needed to read
* decode/iso8859-13.php
* $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.
*
* This file contains iso-8859-13 decoding function that is needed to read
* decode/iso8859-14.php
* $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.
*
* This file contains iso-8859-14 decoding function that is needed to read
* decode/iso8859-15.php
* $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.
*
* This file contains iso-8859-15 decoding function that is needed to read
* decode/iso8859-16.php
* $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.
*
* This file contains iso-8859-16 decoding function that is needed to read
* decode/iso8859-2.php
* $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.
*
* This file contains iso-8859-2 decoding function that is needed to read
* decode/iso8859-3.php
* $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.
*
* This file contains iso-8859-3 decoding function that is needed to read
* decode/iso8859-4.php
* $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.
*
* This file contains iso-8859-4 decoding function that is needed to read
* decode/iso8859-5.php
* $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.
*
* This file contains iso-8859-5 decoding function that is needed to read
* decode/iso8859-6.php
* $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.
*
* This file contains iso-8859-6 decoding function that is needed to read
* decode/iso8859-7.php
* $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.
*
* This file contains iso-8859-7 decoding function that is needed to read
* decode/iso8859-8.php
* $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.
*
* This file contains iso-8859-8 decoding function that is needed to read
* decode/iso8859-9.php
* $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.
*
* This file contains iso-8859-9 decoding function that is needed to read
--- /dev/null
+<?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" => '─',
+ "\x81" => '│',
+ "\x82" => '┌',
+ "\x83" => '┐',
+ "\x84" => '└',
+ "\x85" => '┘',
+ "\x86" => '├',
+ "\x87" => '┤',
+ "\x88" => '┬',
+ "\x89" => '┴',
+ "\x8A" => '┼',
+ "\x8B" => '▀',
+ "\x8C" => '▄',
+ "\x8D" => '█',
+ "\x8E" => '▌',
+ "\x8F" => '▐',
+ "\x90" => '░',
+ "\x91" => '▒',
+ "\x92" => '▓',
+ "\x93" => '⌠',
+ "\x94" => '■',
+ "\x95" => '∙',
+ "\x96" => '√',
+ "\x97" => '≈',
+ "\x98" => '≤',
+ "\x99" => '≥',
+ "\x9A" => ' ',
+ "\x9B" => '⌡',
+ "\x9C" => '°',
+ "\x9D" => '²',
+ "\x9E" => '·',
+ "\x9F" => '÷',
+ "\xA0" => '═',
+ "\xA1" => '║',
+ "\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" => '╬',
+ "\xBF" => '©',
+ "\xC0" => 'ю',
+ "\xC1" => 'а',
+ "\xC2" => 'б',
+ "\xC3" => 'ц',
+ "\xC4" => 'д',
+ "\xC5" => 'е',
+ "\xC6" => 'ф',
+ "\xC7" => 'г',
+ "\xC8" => 'х',
+ "\xC9" => 'и',
+ "\xCA" => 'й',
+ "\xCB" => 'к',
+ "\xCC" => 'л',
+ "\xCD" => 'м',
+ "\xCE" => 'н',
+ "\xCF" => 'о',
+ "\xD0" => 'п',
+ "\xD1" => 'я',
+ "\xD2" => 'р',
+ "\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" => 'Ч',
+ "\xFF" => 'Ъ'
+ );
+
+ $string = str_replace(array_keys($koi8r), array_values($koi8r), $string);
+
+ return $string;
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?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" => '─',
+ "\x81" => '│',
+ "\x82" => '┌',
+ "\x83" => '┐',
+ "\x84" => '└',
+ "\x85" => '┘',
+ "\x86" => '├',
+ "\x87" => '┤',
+ "\x88" => '┬',
+ "\x89" => '┴',
+ "\x8A" => '┼',
+ "\x8B" => '▀',
+ "\x8C" => '▄',
+ "\x8D" => '█',
+ "\x8E" => '▌',
+ "\x8F" => '▐',
+ "\x90" => '░',
+ "\x91" => '▒',
+ "\x92" => '▓',
+ "\x93" => '⌠',
+ "\x94" => '■',
+ "\x95" => '∙',
+ "\x96" => '√',
+ "\x97" => '≈',
+ "\x98" => '≤',
+ "\x99" => '≥',
+ "\x9A" => ' ',
+ "\x9B" => '⌡',
+ "\x9C" => '°',
+ "\x9D" => '²',
+ "\x9E" => '·',
+ "\x9F" => '÷',
+ "\xA0" => '═',
+ "\xA1" => '║',
+ "\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" => '╬',
+ "\xBF" => '©',
+ "\xC0" => 'ю',
+ "\xC1" => 'а',
+ "\xC2" => 'б',
+ "\xC3" => 'ц',
+ "\xC4" => 'д',
+ "\xC5" => 'е',
+ "\xC6" => 'ф',
+ "\xC7" => 'г',
+ "\xC8" => 'х',
+ "\xC9" => 'и',
+ "\xCA" => 'й',
+ "\xCB" => 'к',
+ "\xCC" => 'л',
+ "\xCD" => 'м',
+ "\xCE" => 'н',
+ "\xCF" => 'о',
+ "\xD0" => 'п',
+ "\xD1" => 'я',
+ "\xD2" => 'р',
+ "\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" => 'Ч',
+ "\xFF" => 'Ъ'
+ );
+
+ $string = str_replace(array_keys($koi8u), array_values($koi8u), $string);
+
+ return $string;
+}
+
+?>
\ No newline at end of file
* decode/utf-8.php
* $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.
*
* This file contains utf-8 decoding function that is needed to read
*
*/
function charset_decode_utf8 ($string) {
- global $default_charset, $languages, $sm_notAlias;
+ global $default_charset;
if (strtolower($default_charset) == 'utf-8')
return $string;
- if (strtolower($languages[$sm_notAlias]['CHARSET']) == 'utf-8')
- return $string;
/* 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;
// decode three byte unicode characters