Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / requests / packages / chardet / escsm.py @ 564

History | View | Annotate | Download (7.66 KB)

1
######################## BEGIN LICENSE BLOCK ########################
2
# The Original Code is mozilla.org code.
3
#
4
# The Initial Developer of the Original Code is
5
# Netscape Communications Corporation.
6
# Portions created by the Initial Developer are Copyright (C) 1998
7
# the Initial Developer. All Rights Reserved.
8
#
9
# Contributor(s):
10
#   Mark Pilgrim - port to Python
11
#
12
# This library is free software; you can redistribute it and/or
13
# modify it under the terms of the GNU Lesser General Public
14
# License as published by the Free Software Foundation; either
15
# version 2.1 of the License, or (at your option) any later version.
16
#
17
# This library is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20
# Lesser General Public License for more details.
21
#
22
# You should have received a copy of the GNU Lesser General Public
23
# License along with this library; if not, write to the Free Software
24
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25
# 02110-1301  USA
26
######################### END LICENSE BLOCK #########################
27

    
28
from .constants import eStart, eError, eItsMe
29

    
30
HZ_cls = (
31
1,0,0,0,0,0,0,0,  # 00 - 07
32
0,0,0,0,0,0,0,0,  # 08 - 0f
33
0,0,0,0,0,0,0,0,  # 10 - 17
34
0,0,0,1,0,0,0,0,  # 18 - 1f
35
0,0,0,0,0,0,0,0,  # 20 - 27
36
0,0,0,0,0,0,0,0,  # 28 - 2f
37
0,0,0,0,0,0,0,0,  # 30 - 37
38
0,0,0,0,0,0,0,0,  # 38 - 3f
39
0,0,0,0,0,0,0,0,  # 40 - 47
40
0,0,0,0,0,0,0,0,  # 48 - 4f
41
0,0,0,0,0,0,0,0,  # 50 - 57
42
0,0,0,0,0,0,0,0,  # 58 - 5f
43
0,0,0,0,0,0,0,0,  # 60 - 67
44
0,0,0,0,0,0,0,0,  # 68 - 6f
45
0,0,0,0,0,0,0,0,  # 70 - 77
46
0,0,0,4,0,5,2,0,  # 78 - 7f
47
1,1,1,1,1,1,1,1,  # 80 - 87
48
1,1,1,1,1,1,1,1,  # 88 - 8f
49
1,1,1,1,1,1,1,1,  # 90 - 97
50
1,1,1,1,1,1,1,1,  # 98 - 9f
51
1,1,1,1,1,1,1,1,  # a0 - a7
52
1,1,1,1,1,1,1,1,  # a8 - af
53
1,1,1,1,1,1,1,1,  # b0 - b7
54
1,1,1,1,1,1,1,1,  # b8 - bf
55
1,1,1,1,1,1,1,1,  # c0 - c7
56
1,1,1,1,1,1,1,1,  # c8 - cf
57
1,1,1,1,1,1,1,1,  # d0 - d7
58
1,1,1,1,1,1,1,1,  # d8 - df
59
1,1,1,1,1,1,1,1,  # e0 - e7
60
1,1,1,1,1,1,1,1,  # e8 - ef
61
1,1,1,1,1,1,1,1,  # f0 - f7
62
1,1,1,1,1,1,1,1,  # f8 - ff
63
)
64

    
65
HZ_st = (
66
eStart,eError,     3,eStart,eStart,eStart,eError,eError,# 00-07
67
eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 08-0f
68
eItsMe,eItsMe,eError,eError,eStart,eStart,     4,eError,# 10-17
69
     5,eError,     6,eError,     5,     5,     4,eError,# 18-1f
70
     4,eError,     4,     4,     4,eError,     4,eError,# 20-27
71
     4,eItsMe,eStart,eStart,eStart,eStart,eStart,eStart,# 28-2f
72
)
73

    
74
HZCharLenTable = (0, 0, 0, 0, 0, 0)
75

    
76
HZSMModel = {'classTable': HZ_cls,
77
             'classFactor': 6,
78
             'stateTable': HZ_st,
79
             'charLenTable': HZCharLenTable,
80
             'name': "HZ-GB-2312"}
81

    
82
ISO2022CN_cls = (
83
2,0,0,0,0,0,0,0,  # 00 - 07
84
0,0,0,0,0,0,0,0,  # 08 - 0f
85
0,0,0,0,0,0,0,0,  # 10 - 17
86
0,0,0,1,0,0,0,0,  # 18 - 1f
87
0,0,0,0,0,0,0,0,  # 20 - 27
88
0,3,0,0,0,0,0,0,  # 28 - 2f
89
0,0,0,0,0,0,0,0,  # 30 - 37
90
0,0,0,0,0,0,0,0,  # 38 - 3f
91
0,0,0,4,0,0,0,0,  # 40 - 47
92
0,0,0,0,0,0,0,0,  # 48 - 4f
93
0,0,0,0,0,0,0,0,  # 50 - 57
94
0,0,0,0,0,0,0,0,  # 58 - 5f
95
0,0,0,0,0,0,0,0,  # 60 - 67
96
0,0,0,0,0,0,0,0,  # 68 - 6f
97
0,0,0,0,0,0,0,0,  # 70 - 77
98
0,0,0,0,0,0,0,0,  # 78 - 7f
99
2,2,2,2,2,2,2,2,  # 80 - 87
100
2,2,2,2,2,2,2,2,  # 88 - 8f
101
2,2,2,2,2,2,2,2,  # 90 - 97
102
2,2,2,2,2,2,2,2,  # 98 - 9f
103
2,2,2,2,2,2,2,2,  # a0 - a7
104
2,2,2,2,2,2,2,2,  # a8 - af
105
2,2,2,2,2,2,2,2,  # b0 - b7
106
2,2,2,2,2,2,2,2,  # b8 - bf
107
2,2,2,2,2,2,2,2,  # c0 - c7
108
2,2,2,2,2,2,2,2,  # c8 - cf
109
2,2,2,2,2,2,2,2,  # d0 - d7
110
2,2,2,2,2,2,2,2,  # d8 - df
111
2,2,2,2,2,2,2,2,  # e0 - e7
112
2,2,2,2,2,2,2,2,  # e8 - ef
113
2,2,2,2,2,2,2,2,  # f0 - f7
114
2,2,2,2,2,2,2,2,  # f8 - ff
115
)
116

    
117
ISO2022CN_st = (
118
eStart,     3,eError,eStart,eStart,eStart,eStart,eStart,# 00-07
119
eStart,eError,eError,eError,eError,eError,eError,eError,# 08-0f
120
eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,# 10-17
121
eItsMe,eItsMe,eItsMe,eError,eError,eError,     4,eError,# 18-1f
122
eError,eError,eError,eItsMe,eError,eError,eError,eError,# 20-27
123
     5,     6,eError,eError,eError,eError,eError,eError,# 28-2f
124
eError,eError,eError,eItsMe,eError,eError,eError,eError,# 30-37
125
eError,eError,eError,eError,eError,eItsMe,eError,eStart,# 38-3f
126
)
127

    
128
ISO2022CNCharLenTable = (0, 0, 0, 0, 0, 0, 0, 0, 0)
129

    
130
ISO2022CNSMModel = {'classTable': ISO2022CN_cls,
131
                    'classFactor': 9,
132
                    'stateTable': ISO2022CN_st,
133
                    'charLenTable': ISO2022CNCharLenTable,
134
                    'name': "ISO-2022-CN"}
135

    
136
ISO2022JP_cls = (
137
2,0,0,0,0,0,0,0,  # 00 - 07
138
0,0,0,0,0,0,2,2,  # 08 - 0f
139
0,0,0,0,0,0,0,0,  # 10 - 17
140
0,0,0,1,0,0,0,0,  # 18 - 1f
141
0,0,0,0,7,0,0,0,  # 20 - 27
142
3,0,0,0,0,0,0,0,  # 28 - 2f
143
0,0,0,0,0,0,0,0,  # 30 - 37
144
0,0,0,0,0,0,0,0,  # 38 - 3f
145
6,0,4,0,8,0,0,0,  # 40 - 47
146
0,9,5,0,0,0,0,0,  # 48 - 4f
147
0,0,0,0,0,0,0,0,  # 50 - 57
148
0,0,0,0,0,0,0,0,  # 58 - 5f
149
0,0,0,0,0,0,0,0,  # 60 - 67
150
0,0,0,0,0,0,0,0,  # 68 - 6f
151
0,0,0,0,0,0,0,0,  # 70 - 77
152
0,0,0,0,0,0,0,0,  # 78 - 7f
153
2,2,2,2,2,2,2,2,  # 80 - 87
154
2,2,2,2,2,2,2,2,  # 88 - 8f
155
2,2,2,2,2,2,2,2,  # 90 - 97
156
2,2,2,2,2,2,2,2,  # 98 - 9f
157
2,2,2,2,2,2,2,2,  # a0 - a7
158
2,2,2,2,2,2,2,2,  # a8 - af
159
2,2,2,2,2,2,2,2,  # b0 - b7
160
2,2,2,2,2,2,2,2,  # b8 - bf
161
2,2,2,2,2,2,2,2,  # c0 - c7
162
2,2,2,2,2,2,2,2,  # c8 - cf
163
2,2,2,2,2,2,2,2,  # d0 - d7
164
2,2,2,2,2,2,2,2,  # d8 - df
165
2,2,2,2,2,2,2,2,  # e0 - e7
166
2,2,2,2,2,2,2,2,  # e8 - ef
167
2,2,2,2,2,2,2,2,  # f0 - f7
168
2,2,2,2,2,2,2,2,  # f8 - ff
169
)
170

    
171
ISO2022JP_st = (
172
eStart,     3,eError,eStart,eStart,eStart,eStart,eStart,# 00-07
173
eStart,eStart,eError,eError,eError,eError,eError,eError,# 08-0f
174
eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 10-17
175
eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,# 18-1f
176
eError,     5,eError,eError,eError,     4,eError,eError,# 20-27
177
eError,eError,eError,     6,eItsMe,eError,eItsMe,eError,# 28-2f
178
eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,# 30-37
179
eError,eError,eError,eItsMe,eError,eError,eError,eError,# 38-3f
180
eError,eError,eError,eError,eItsMe,eError,eStart,eStart,# 40-47
181
)
182

    
183
ISO2022JPCharLenTable = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
184

    
185
ISO2022JPSMModel = {'classTable': ISO2022JP_cls,
186
                    'classFactor': 10,
187
                    'stateTable': ISO2022JP_st,
188
                    'charLenTable': ISO2022JPCharLenTable,
189
                    'name': "ISO-2022-JP"}
190

    
191
ISO2022KR_cls = (
192
2,0,0,0,0,0,0,0,  # 00 - 07
193
0,0,0,0,0,0,0,0,  # 08 - 0f
194
0,0,0,0,0,0,0,0,  # 10 - 17
195
0,0,0,1,0,0,0,0,  # 18 - 1f
196
0,0,0,0,3,0,0,0,  # 20 - 27
197
0,4,0,0,0,0,0,0,  # 28 - 2f
198
0,0,0,0,0,0,0,0,  # 30 - 37
199
0,0,0,0,0,0,0,0,  # 38 - 3f
200
0,0,0,5,0,0,0,0,  # 40 - 47
201
0,0,0,0,0,0,0,0,  # 48 - 4f
202
0,0,0,0,0,0,0,0,  # 50 - 57
203
0,0,0,0,0,0,0,0,  # 58 - 5f
204
0,0,0,0,0,0,0,0,  # 60 - 67
205
0,0,0,0,0,0,0,0,  # 68 - 6f
206
0,0,0,0,0,0,0,0,  # 70 - 77
207
0,0,0,0,0,0,0,0,  # 78 - 7f
208
2,2,2,2,2,2,2,2,  # 80 - 87
209
2,2,2,2,2,2,2,2,  # 88 - 8f
210
2,2,2,2,2,2,2,2,  # 90 - 97
211
2,2,2,2,2,2,2,2,  # 98 - 9f
212
2,2,2,2,2,2,2,2,  # a0 - a7
213
2,2,2,2,2,2,2,2,  # a8 - af
214
2,2,2,2,2,2,2,2,  # b0 - b7
215
2,2,2,2,2,2,2,2,  # b8 - bf
216
2,2,2,2,2,2,2,2,  # c0 - c7
217
2,2,2,2,2,2,2,2,  # c8 - cf
218
2,2,2,2,2,2,2,2,  # d0 - d7
219
2,2,2,2,2,2,2,2,  # d8 - df
220
2,2,2,2,2,2,2,2,  # e0 - e7
221
2,2,2,2,2,2,2,2,  # e8 - ef
222
2,2,2,2,2,2,2,2,  # f0 - f7
223
2,2,2,2,2,2,2,2,  # f8 - ff
224
)
225

    
226
ISO2022KR_st = (
227
eStart,     3,eError,eStart,eStart,eStart,eError,eError,# 00-07
228
eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 08-0f
229
eItsMe,eItsMe,eError,eError,eError,     4,eError,eError,# 10-17
230
eError,eError,eError,eError,     5,eError,eError,eError,# 18-1f
231
eError,eError,eError,eItsMe,eStart,eStart,eStart,eStart,# 20-27
232
)
233

    
234
ISO2022KRCharLenTable = (0, 0, 0, 0, 0, 0)
235

    
236
ISO2022KRSMModel = {'classTable': ISO2022KR_cls,
237
                    'classFactor': 6,
238
                    'stateTable': ISO2022KR_st,
239
                    'charLenTable': ISO2022KRCharLenTable,
240
                    'name': "ISO-2022-KR"}
241

    
242
# flake8: noqa