|
@@ -19,21 +19,21 @@
|
|
* Authors: Ken Whistler <kenw@sybase.com>
|
|
* Authors: Ken Whistler <kenw@sybase.com>
|
|
*
|
|
*
|
|
* Original copyright:
|
|
* Original copyright:
|
|
- * Copyright (c) 1999 Unicode, Inc. All Rights reserved.
|
|
|
|
|
|
+ * 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.
|
|
|
|
|
|
+ * 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.
|
|
|
|
|
|
+ * 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.
|
|
*
|
|
*
|
|
* @version $Id$
|
|
* @version $Id$
|
|
* @package squirrelmail
|
|
* @package squirrelmail
|
|
@@ -51,108 +51,107 @@ function charset_decode_iso_8859_10 ($string) {
|
|
if (strtolower($default_charset) == 'iso-8859-10')
|
|
if (strtolower($default_charset) == 'iso-8859-10')
|
|
return $string;
|
|
return $string;
|
|
|
|
|
|
- /* Only do the slow convert if there are 8-bit characters */
|
|
|
|
- /* there is no 0x80-0x9F letters in ISO8859-* */
|
|
|
|
- if ( ! ereg("[\241-\377]", $string) )
|
|
|
|
|
|
+ // don't do decoding when there are no 8bit symbols
|
|
|
|
+ if (! sq_is8bit($string,'iso-8859-10'))
|
|
return $string;
|
|
return $string;
|
|
|
|
|
|
$iso8859_10 = array(
|
|
$iso8859_10 = array(
|
|
- "\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" => 'ĸ'
|
|
|
|
|
|
+ "\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($iso8859_10), array_values($iso8859_10), $string);
|
|
$string = str_replace(array_keys($iso8859_10), array_values($iso8859_10), $string);
|
|
@@ -160,4 +159,4 @@ function charset_decode_iso_8859_10 ($string) {
|
|
return $string;
|
|
return $string;
|
|
}
|
|
}
|
|
|
|
|
|
-?>
|
|
|
|
|
|
+?>
|