~ubuntu-branches/ubuntu/hardy/squirrelmail/hardy-updates

« back to all changes in this revision

Viewing changes to functions/decode/iso_8859_13.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2005-02-06 21:41:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050206214151-z4n1o8mnttgzuj0y
Tags: 2:1.4.4-3
* Move default_pref config file from /var to /etc, as per Debian policy
  (Closes: #293281)
* [JvW] (finally) override two lintian warnings about nonstandard
  permissions that are intentional (Closes: #293366)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
/**
3
3
 * decode/iso8859-13.php
4
 
 * $Id: iso_8859_13.php,v 1.1 2003/12/21 11:40:08 tokul Exp $
5
4
 *
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.
8
7
 *
9
8
 * This file contains iso-8859-13 decoding function that is needed to read
20
19
 *   Authors:          Ken Whistler <kenw@sybase.com>
21
20
 *
22
21
 * Original copyright:
23
 
 *      Copyright (c) 1999 Unicode, Inc.  All Rights reserved.
24
 
 *
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
31
 
 *      days of receipt.
32
 
 *
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
37
 
 *      attached.
 
22
 *  Copyright (c) 1999 Unicode, Inc.  All Rights reserved.
 
23
 *
 
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
 
30
 *  days of receipt.
 
31
 *
 
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
 
36
 *  attached.
 
37
 *
 
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
40
41
 */
45
46
 * @return string $string Decoded string
46
47
 */
47
48
function charset_decode_iso_8859_13 ($string) {
48
 
    global $default_charset;
49
 
 
50
 
    if (strtolower($default_charset) == 'iso-8859-13')
51
 
        return $string;
52
 
 
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'))
56
51
        return $string;
57
52
 
58
53
    $iso8859_13 = array(
59
 
        "\xA0" => '&#160;',
60
 
        "\xA1" => '&#8221;',
61
 
        "\xA2" => '&#162;',
62
 
        "\xA3" => '&#163;',
63
 
        "\xA4" => '&#164;',
64
 
        "\xA5" => '&#8222;',
65
 
        "\xA6" => '&#166;',
66
 
        "\xA7" => '&#167;',
67
 
        "\xA8" => '&#216;',
68
 
        "\xA9" => '&#169;',
69
 
        "\xAA" => '&#342;',
70
 
        "\xAB" => '&#171;',
71
 
        "\xAC" => '&#172;',
72
 
        "\xAD" => '&#173;',
73
 
        "\xAE" => '&#174;',
74
 
        "\xAF" => '&#198;',
75
 
        "\xB0" => '&#176;',
76
 
        "\xB1" => '&#177;',
77
 
        "\xB2" => '&#178;',
78
 
        "\xB3" => '&#179;',
79
 
        "\xB4" => '&#8220;',
80
 
        "\xB5" => '&#181;',
81
 
        "\xB6" => '&#182;',
82
 
        "\xB7" => '&#183;',
83
 
        "\xB8" => '&#248;',
84
 
        "\xB9" => '&#185;',
85
 
        "\xBA" => '&#343;',
86
 
        "\xBB" => '&#187;',
87
 
        "\xBC" => '&#188;',
88
 
        "\xBD" => '&#189;',
89
 
        "\xBE" => '&#190;',
90
 
        "\xBF" => '&#230;',
91
 
        "\xC0" => '&#260;',
92
 
        "\xC1" => '&#302;',
93
 
        "\xC2" => '&#256;',
94
 
        "\xC3" => '&#262;',
95
 
        "\xC4" => '&#196;',
96
 
        "\xC5" => '&#197;',
97
 
        "\xC6" => '&#280;',
98
 
        "\xC7" => '&#274;',
99
 
        "\xC8" => '&#268;',
100
 
        "\xC9" => '&#201;',
101
 
        "\xCA" => '&#377;',
102
 
        "\xCB" => '&#278;',
103
 
        "\xCC" => '&#290;',
104
 
        "\xCD" => '&#310;',
105
 
        "\xCE" => '&#298;',
106
 
        "\xCF" => '&#315;',
107
 
        "\xD0" => '&#352;',
108
 
        "\xD1" => '&#323;',
109
 
        "\xD2" => '&#325;',
110
 
        "\xD3" => '&#211;',
111
 
        "\xD4" => '&#332;',
112
 
        "\xD5" => '&#213;',
113
 
        "\xD6" => '&#214;',
114
 
        "\xD7" => '&#215;',
115
 
        "\xD8" => '&#370;',
116
 
        "\xD9" => '&#321;',
117
 
        "\xDA" => '&#346;',
118
 
        "\xDB" => '&#362;',
119
 
        "\xDC" => '&#220;',
120
 
        "\xDD" => '&#379;',
121
 
        "\xDE" => '&#381;',
122
 
        "\xDF" => '&#223;',
123
 
        "\xE0" => '&#261;',
124
 
        "\xE1" => '&#303;',
125
 
        "\xE2" => '&#257;',
126
 
        "\xE3" => '&#263;',
127
 
        "\xE4" => '&#228;',
128
 
        "\xE5" => '&#229;',
129
 
        "\xE6" => '&#281;',
130
 
        "\xE7" => '&#275;',
131
 
        "\xE8" => '&#269;',
132
 
        "\xE9" => '&#233;',
133
 
        "\xEA" => '&#378;',
134
 
        "\xEB" => '&#279;',
135
 
        "\xEC" => '&#291;',
136
 
        "\xED" => '&#311;',
137
 
        "\xEE" => '&#299;',
138
 
        "\xEF" => '&#316;',
139
 
        "\xF0" => '&#353;',
140
 
        "\xF1" => '&#324;',
141
 
        "\xF2" => '&#326;',
142
 
        "\xF3" => '&#243;',
143
 
        "\xF4" => '&#333;',
144
 
        "\xF5" => '&#245;',
145
 
        "\xF6" => '&#246;',
146
 
        "\xF7" => '&#247;',
147
 
        "\xF8" => '&#371;',
148
 
        "\xF9" => '&#322;',
149
 
        "\xFA" => '&#347;',
150
 
        "\xFB" => '&#363;',
151
 
        "\xFC" => '&#252;',
152
 
        "\xFD" => '&#380;',
153
 
        "\xFE" => '&#382;',
154
 
        "\xFF" => '&#8217;'
 
54
        "\xA0" => '&#160;',
 
55
        "\xA1" => '&#8221;',
 
56
        "\xA2" => '&#162;',
 
57
        "\xA3" => '&#163;',
 
58
        "\xA4" => '&#164;',
 
59
        "\xA5" => '&#8222;',
 
60
        "\xA6" => '&#166;',
 
61
        "\xA7" => '&#167;',
 
62
        "\xA8" => '&#216;',
 
63
        "\xA9" => '&#169;',
 
64
        "\xAA" => '&#342;',
 
65
        "\xAB" => '&#171;',
 
66
        "\xAC" => '&#172;',
 
67
        "\xAD" => '&#173;',
 
68
        "\xAE" => '&#174;',
 
69
        "\xAF" => '&#198;',
 
70
        "\xB0" => '&#176;',
 
71
        "\xB1" => '&#177;',
 
72
        "\xB2" => '&#178;',
 
73
        "\xB3" => '&#179;',
 
74
        "\xB4" => '&#8220;',
 
75
        "\xB5" => '&#181;',
 
76
        "\xB6" => '&#182;',
 
77
        "\xB7" => '&#183;',
 
78
        "\xB8" => '&#248;',
 
79
        "\xB9" => '&#185;',
 
80
        "\xBA" => '&#343;',
 
81
        "\xBB" => '&#187;',
 
82
        "\xBC" => '&#188;',
 
83
        "\xBD" => '&#189;',
 
84
        "\xBE" => '&#190;',
 
85
        "\xBF" => '&#230;',
 
86
        "\xC0" => '&#260;',
 
87
        "\xC1" => '&#302;',
 
88
        "\xC2" => '&#256;',
 
89
        "\xC3" => '&#262;',
 
90
        "\xC4" => '&#196;',
 
91
        "\xC5" => '&#197;',
 
92
        "\xC6" => '&#280;',
 
93
        "\xC7" => '&#274;',
 
94
        "\xC8" => '&#268;',
 
95
        "\xC9" => '&#201;',
 
96
        "\xCA" => '&#377;',
 
97
        "\xCB" => '&#278;',
 
98
        "\xCC" => '&#290;',
 
99
        "\xCD" => '&#310;',
 
100
        "\xCE" => '&#298;',
 
101
        "\xCF" => '&#315;',
 
102
        "\xD0" => '&#352;',
 
103
        "\xD1" => '&#323;',
 
104
        "\xD2" => '&#325;',
 
105
        "\xD3" => '&#211;',
 
106
        "\xD4" => '&#332;',
 
107
        "\xD5" => '&#213;',
 
108
        "\xD6" => '&#214;',
 
109
        "\xD7" => '&#215;',
 
110
        "\xD8" => '&#370;',
 
111
        "\xD9" => '&#321;',
 
112
        "\xDA" => '&#346;',
 
113
        "\xDB" => '&#362;',
 
114
        "\xDC" => '&#220;',
 
115
        "\xDD" => '&#379;',
 
116
        "\xDE" => '&#381;',
 
117
        "\xDF" => '&#223;',
 
118
        "\xE0" => '&#261;',
 
119
        "\xE1" => '&#303;',
 
120
        "\xE2" => '&#257;',
 
121
        "\xE3" => '&#263;',
 
122
        "\xE4" => '&#228;',
 
123
        "\xE5" => '&#229;',
 
124
        "\xE6" => '&#281;',
 
125
        "\xE7" => '&#275;',
 
126
        "\xE8" => '&#269;',
 
127
        "\xE9" => '&#233;',
 
128
        "\xEA" => '&#378;',
 
129
        "\xEB" => '&#279;',
 
130
        "\xEC" => '&#291;',
 
131
        "\xED" => '&#311;',
 
132
        "\xEE" => '&#299;',
 
133
        "\xEF" => '&#316;',
 
134
        "\xF0" => '&#353;',
 
135
        "\xF1" => '&#324;',
 
136
        "\xF2" => '&#326;',
 
137
        "\xF3" => '&#243;',
 
138
        "\xF4" => '&#333;',
 
139
        "\xF5" => '&#245;',
 
140
        "\xF6" => '&#246;',
 
141
        "\xF7" => '&#247;',
 
142
        "\xF8" => '&#371;',
 
143
        "\xF9" => '&#322;',
 
144
        "\xFA" => '&#347;',
 
145
        "\xFB" => '&#363;',
 
146
        "\xFC" => '&#252;',
 
147
        "\xFD" => '&#380;',
 
148
        "\xFE" => '&#382;',
 
149
        "\xFF" => '&#8217;'
155
150
    );
156
151
 
157
152
    $string = str_replace(array_keys($iso8859_13), array_values($iso8859_13), $string);
159
154
    return $string;
160
155
}
161
156
 
162
 
?>
 
157
?>
 
 
b'\\ No newline at end of file'