7#include "nsCodingStateMachine.h"
17namespace kencodingprober
19static const unsigned int BIG5_cls[256 / 8] = {
21 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
22 PCK4BITS(1, 1, 1, 1, 1, 1, 0, 0),
23 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
24 PCK4BITS(1, 1, 1, 0, 1, 1, 1, 1),
25 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
26 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
27 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
28 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
29 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
30 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
31 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
32 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
33 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
34 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
35 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
36 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 1),
37 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
38 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
39 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
40 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
41 PCK4BITS(4, 3, 3, 3, 3, 3, 3, 3),
42 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
43 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
44 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
45 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
46 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
47 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
48 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
49 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
50 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
51 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
52 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 0)
55static const unsigned int BIG5_st[3] = {
56 PCK4BITS(eError, eStart, eStart, 3, eError, eError, eError, eError),
57 PCK4BITS(eError, eError, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eError),
58 PCK4BITS(eError, eStart, eStart, eStart, eStart, eStart, eStart, eStart)
61static const unsigned int Big5CharLenTable[] = {0, 1, 1, 2, 0};
63const SMModel Big5SMModel = {
64 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, BIG5_cls},
66 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, BIG5_st},
71static const unsigned int EUCJP_cls[256 / 8] = {
73 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
74 PCK4BITS(4, 4, 4, 4, 4, 4, 5, 5),
75 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
76 PCK4BITS(4, 4, 4, 5, 4, 4, 4, 4),
77 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
78 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
79 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
80 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
81 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
82 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
83 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
84 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
85 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
86 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
87 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
88 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
89 PCK4BITS(5, 5, 5, 5, 5, 5, 5, 5),
90 PCK4BITS(5, 5, 5, 5, 5, 5, 1, 3),
91 PCK4BITS(5, 5, 5, 5, 5, 5, 5, 5),
92 PCK4BITS(5, 5, 5, 5, 5, 5, 5, 5),
93 PCK4BITS(5, 2, 2, 2, 2, 2, 2, 2),
94 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
95 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
96 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
97 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
98 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
99 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
100 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
101 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
102 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
103 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
104 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 5)
107static const unsigned int EUCJP_st[5] = {
108 PCK4BITS(3, 4, 3, 5, eStart, eError, eError, eError),
109 PCK4BITS(eError, eError, eError, eError, eItsMe, eItsMe, eItsMe, eItsMe),
110 PCK4BITS(eItsMe, eItsMe, eStart, eError, eStart, eError, eError, eError),
111 PCK4BITS(eError, eError, eStart, eError, eError, eError, 3, eError),
112 PCK4BITS(3, eError, eError, eError, eStart, eStart, eStart, eStart)
115static const unsigned int EUCJPCharLenTable[] = {2, 2, 2, 3, 1, 0};
117const SMModel EUCJPSMModel = {
118 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCJP_cls},
120 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCJP_st},
125static const unsigned int EUCKR_cls[256 / 8] = {
127 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
128 PCK4BITS(1, 1, 1, 1, 1, 1, 0, 0),
129 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
130 PCK4BITS(1, 1, 1, 0, 1, 1, 1, 1),
131 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
132 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
133 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
134 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
135 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
136 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
137 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
138 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
139 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
140 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
141 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
142 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
143 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
144 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
145 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
146 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
147 PCK4BITS(0, 2, 2, 2, 2, 2, 2, 2),
148 PCK4BITS(2, 2, 2, 2, 2, 3, 3, 3),
149 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
150 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
151 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
152 PCK4BITS(2, 3, 2, 2, 2, 2, 2, 2),
153 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
154 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
155 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
156 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
157 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
158 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 0)
161static const unsigned int EUCKR_st[2] = {
162 PCK4BITS(eError, eStart, 3, eError, eError, eError, eError, eError),
163 PCK4BITS(eItsMe, eItsMe, eItsMe, eItsMe, eError, eError, eStart, eStart)
166static const unsigned int EUCKRCharLenTable[] = {0, 1, 2, 0};
168const SMModel EUCKRSMModel = {
169 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCKR_cls},
171 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCKR_st},
231static const unsigned int GB18030_cls[256 / 8] = {
232 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
233 PCK4BITS(1, 1, 1, 1, 1, 1, 0, 0),
234 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
235 PCK4BITS(1, 1, 1, 0, 1, 1, 1, 1),
236 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
237 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
238 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
239 PCK4BITS(3, 3, 1, 1, 1, 1, 1, 1),
240 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
241 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
242 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
243 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
244 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
245 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
246 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
247 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 4),
248 PCK4BITS(5, 6, 6, 6, 6, 6, 6, 6),
249 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
250 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
251 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
252 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
253 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
254 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
255 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
256 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
257 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
258 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
259 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
260 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
261 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
262 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
263 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 0)
266static const unsigned int GB18030_st[6] = {
267 PCK4BITS(eError, eStart, eStart, eStart, eStart, eStart, 3, eError),
268 PCK4BITS(eError, eError, eError, eError, eError, eError, eItsMe, eItsMe),
269 PCK4BITS(eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eError, eError, eStart),
270 PCK4BITS(4, eError, eStart, eStart, eError, eError, eError, eError),
271 PCK4BITS(eError, eError, 5, eError, eError, eError, eItsMe, eError),
272 PCK4BITS(eError, eError, eStart, eStart, eStart, eStart, eStart, eStart)
280static const unsigned int GB18030CharLenTable[] = {0, 1, 1, 1, 1, 1, 2};
282const SMModel GB18030SMModel = {
283 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, GB18030_cls},
285 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, GB18030_st},
292static const unsigned int SJIS_cls[256 / 8] = {
294 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
295 PCK4BITS(1, 1, 1, 1, 1, 1, 0, 0),
296 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
297 PCK4BITS(1, 1, 1, 0, 1, 1, 1, 1),
298 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
299 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
300 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
301 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
302 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
303 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
304 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
305 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
306 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
307 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
308 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
309 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 1),
310 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
311 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
312 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
313 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
316 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
317 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
318 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
319 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
320 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
321 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
322 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
323 PCK4BITS(2, 2, 2, 2, 2, 2, 2, 2),
324 PCK4BITS(3, 3, 3, 3, 3, 3, 3, 3),
325 PCK4BITS(3, 3, 3, 3, 3, 4, 4, 4),
326 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
327 PCK4BITS(4, 4, 4, 4, 4, 0, 0, 0)
330static const unsigned int SJIS_st[3] = {
331 PCK4BITS(eError, eStart, eStart, 3, eError, eError, eError, eError),
332 PCK4BITS(eError, eError, eError, eError, eItsMe, eItsMe, eItsMe, eItsMe),
333 PCK4BITS(eItsMe, eItsMe, eError, eError, eStart, eStart, eStart, eStart)
336static const unsigned int SJISCharLenTable[] = {0, 1, 1, 2, 0, 0};
338const SMModel SJISSMModel = {
339 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, SJIS_cls},
341 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, SJIS_st},
346static const unsigned int UCS2BE_cls[256 / 8] = {
347 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
348 PCK4BITS(0, 0, 1, 0, 0, 2, 0, 0),
349 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
350 PCK4BITS(0, 0, 0, 3, 0, 0, 0, 0),
351 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
352 PCK4BITS(0, 3, 3, 3, 3, 3, 0, 0),
353 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
354 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
355 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
356 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
357 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
358 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
359 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
360 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
361 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
362 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
363 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
364 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
365 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
366 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
367 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
368 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
369 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
370 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
371 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
372 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
373 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
374 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
375 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
376 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
377 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
378 PCK4BITS(0, 0, 0, 0, 0, 0, 4, 5)
381static const unsigned int UCS2BE_st[7] = {
382 PCK4BITS(5, 7, 7, eError, 4, 3, eError, eError),
383 PCK4BITS(eError, eError, eError, eError, eItsMe, eItsMe, eItsMe, eItsMe),
384 PCK4BITS(eItsMe, eItsMe, 6, 6, 6, 6, eError, eError),
385 PCK4BITS(6, 6, 6, 6, 6, eItsMe, 6, 6),
386 PCK4BITS(6, 6, 6, 6, 5, 7, 7, eError),
387 PCK4BITS(5, 8, 6, 6, eError, 6, 6, 6),
388 PCK4BITS(6, 6, 6, 6, eError, eError, eStart, eStart)
391static const unsigned int UCS2BECharLenTable[] = {2, 2, 2, 0, 2, 2};
393const SMModel UCS2BESMModel = {
394 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UCS2BE_cls},
396 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UCS2BE_st},
401static const unsigned int UCS2LE_cls[256 / 8] = {
402 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
403 PCK4BITS(0, 0, 1, 0, 0, 2, 0, 0),
404 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
405 PCK4BITS(0, 0, 0, 3, 0, 0, 0, 0),
406 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
407 PCK4BITS(0, 3, 3, 3, 3, 3, 0, 0),
408 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
409 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
410 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
411 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
412 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
413 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
414 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
415 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
416 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
417 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
418 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
419 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
420 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
421 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
422 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
423 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
424 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
425 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
426 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
427 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
428 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
429 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
430 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
431 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
432 PCK4BITS(0, 0, 0, 0, 0, 0, 0, 0),
433 PCK4BITS(0, 0, 0, 0, 0, 0, 4, 5)
436static const unsigned int UCS2LE_st[7] = {
437 PCK4BITS(6, 6, 7, 6, 4, 3, eError, eError),
438 PCK4BITS(eError, eError, eError, eError, eItsMe, eItsMe, eItsMe, eItsMe),
439 PCK4BITS(eItsMe, eItsMe, 5, 5, 5, eError, eItsMe, eError),
440 PCK4BITS(5, 5, 5, eError, 5, eError, 6, 6),
441 PCK4BITS(7, 6, 8, 8, 5, 5, 5, eError),
442 PCK4BITS(5, 5, 5, eError, eError, eError, 5, 5),
443 PCK4BITS(5, 5, 5, eError, 5, eError, eStart, eStart)
446static const unsigned int UCS2LECharLenTable[] = {2, 2, 2, 2, 2, 2};
448const SMModel UCS2LESMModel = {
449 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UCS2LE_cls},
451 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UCS2LE_st},
456static const unsigned int UTF8_cls[256 / 8] = {
458 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
459 PCK4BITS(1, 1, 1, 1, 1, 1, 0, 0),
460 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
461 PCK4BITS(1, 1, 1, 0, 1, 1, 1, 1),
462 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
463 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
464 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
465 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
466 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
467 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
468 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
469 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
470 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
471 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
472 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
473 PCK4BITS(1, 1, 1, 1, 1, 1, 1, 1),
474 PCK4BITS(2, 2, 2, 2, 3, 3, 3, 3),
475 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
476 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
477 PCK4BITS(4, 4, 4, 4, 4, 4, 4, 4),
478 PCK4BITS(5, 5, 5, 5, 5, 5, 5, 5),
479 PCK4BITS(5, 5, 5, 5, 5, 5, 5, 5),
480 PCK4BITS(5, 5, 5, 5, 5, 5, 5, 5),
481 PCK4BITS(5, 5, 5, 5, 5, 5, 5, 5),
482 PCK4BITS(0, 0, 6, 6, 6, 6, 6, 6),
483 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
484 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
485 PCK4BITS(6, 6, 6, 6, 6, 6, 6, 6),
486 PCK4BITS(7, 8, 8, 8, 8, 8, 8, 8),
487 PCK4BITS(8, 8, 8, 8, 8, 9, 8, 8),
488 PCK4BITS(10, 11, 11, 11, 11, 11, 11, 11),
489 PCK4BITS(12, 13, 13, 13, 14, 15, 0, 0)
492static const unsigned int UTF8_st[26] = {
493 PCK4BITS(eError, eStart, eError, eError, eError, eError, 12, 10),
494 PCK4BITS(9, 11, 8, 7, 6, 5, 4, 3),
495 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
496 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
497 PCK4BITS(eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe),
498 PCK4BITS(eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe, eItsMe),
499 PCK4BITS(eError, eError, 5, 5, 5, 5, eError, eError),
500 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
501 PCK4BITS(eError, eError, eError, 5, 5, 5, eError, eError),
502 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
503 PCK4BITS(eError, eError, 7, 7, 7, 7, eError, eError),
504 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
505 PCK4BITS(eError, eError, eError, eError, 7, 7, eError, eError),
506 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
507 PCK4BITS(eError, eError, 9, 9, 9, 9, eError, eError),
508 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
509 PCK4BITS(eError, eError, eError, eError, eError, 9, eError, eError),
510 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
511 PCK4BITS(eError, eError, 12, 12, 12, 12, eError, eError),
512 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
513 PCK4BITS(eError, eError, eError, eError, eError, 12, eError, eError),
514 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
515 PCK4BITS(eError, eError, 12, 12, 12, eError, eError, eError),
516 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError),
517 PCK4BITS(eError, eError, eStart, eStart, eStart, eStart, eError, eError),
518 PCK4BITS(eError, eError, eError, eError, eError, eError, eError, eError)
521static const unsigned int UTF8CharLenTable[] = {0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6};
523const SMModel UTF8SMModel = {
524 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UTF8_cls},
526 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UTF8_st},