* * Original copyright: * 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. * * 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_iso8859_16 ($string) { global $default_charset; if (strtolower($default_charset) == 'iso-8859-16') 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) ) return $string; $iso8869_16 = 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" => 'ÿ' ); $string = str_replace(array_keys($iso8859_16), array_values($iso8859_16), $string); return $string; } ?>