3
3
* decode/iso8859-13.php
4
* $Id: iso_8859_13.php,v 1.1 2003/12/21 11:40:08 tokul Exp $
6
* Copyright (c) 2003 The SquirrelMail Project Team
5
* Copyright (c) 2003-2005 The SquirrelMail Project Team
7
6
* Licensed under the GNU GPL. For full terms see the file COPYING.
9
8
* This file contains iso-8859-13 decoding function that is needed to read
20
19
* Authors: Ken Whistler <kenw@sybase.com>
22
21
* Original copyright:
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
22
* Copyright (c) 1999 Unicode, Inc. All Rights reserved.
24
* This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
25
* No claims are made as to fitness for any particular purpose. No
26
* warranties of any kind are expressed or implied. The recipient
27
* agrees to determine applicability of information provided. If this
28
* file has been provided on optical media by Unicode, Inc., the sole
29
* remedy for any claim will be exchange of defective media within 90
32
* Unicode, Inc. hereby grants the right to freely use the information
33
* supplied in this file in the creation of products supporting the
34
* Unicode Standard, and to make copies of this file in any form for
35
* internal or external distribution as long as this notice remains
38
* @version $Id: iso_8859_13.php,v 1.3.2.4 2004/12/27 15:03:47 kink Exp $
38
39
* @package squirrelmail
39
40
* @subpackage decode
45
46
* @return string $string Decoded string
47
48
function charset_decode_iso_8859_13 ($string) {
48
global $default_charset;
50
if (strtolower($default_charset) == 'iso-8859-13')
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) )
49
// don't do decoding when there are no 8bit symbols
50
if (! sq_is8bit($string,'iso-8859-13'))
58
53
$iso8859_13 = array(
157
152
$string = str_replace(array_keys($iso8859_13), array_values($iso8859_13), $string);