• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • localization
  • probers
nsEscSM.cpp
Go to the documentation of this file.
1/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* -*- C++ -*-
3* Copyright (C) 1998 <developer@mozilla.org>
4*
5*
6* Permission is hereby granted, free of charge, to any person obtaining
7* a copy of this software and associated documentation files (the
8* "Software"), to deal in the Software without restriction, including
9* without limitation the rights to use, copy, modify, merge, publish,
10* distribute, sublicense, and/or sell copies of the Software, and to
11* permit persons to whom the Software is furnished to do so, subject to
12* the following conditions:
13*
14* The above copyright notice and this permission notice shall be included
15* in all copies or substantial portions of the Software.
16*
17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24*/
25
26#include "nsCodingStateMachine.h"
27
28namespace kencodingprober {
29static unsigned int HZ_cls[ 256 / 8 ] = {
30PCK4BITS(1,0,0,0,0,0,0,0), // 00 - 07
31PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
32PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
33PCK4BITS(0,0,0,1,0,0,0,0), // 18 - 1f
34PCK4BITS(0,0,0,0,0,0,0,0), // 20 - 27
35PCK4BITS(0,0,0,0,0,0,0,0), // 28 - 2f
36PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
37PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
38PCK4BITS(0,0,0,0,0,0,0,0), // 40 - 47
39PCK4BITS(0,0,0,0,0,0,0,0), // 48 - 4f
40PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
41PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
42PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
43PCK4BITS(0,0,0,0,0,0,0,0), // 68 - 6f
44PCK4BITS(0,0,0,0,0,0,0,0), // 70 - 77
45PCK4BITS(0,0,0,4,0,5,2,0), // 78 - 7f
46PCK4BITS(1,1,1,1,1,1,1,1), // 80 - 87
47PCK4BITS(1,1,1,1,1,1,1,1), // 88 - 8f
48PCK4BITS(1,1,1,1,1,1,1,1), // 90 - 97
49PCK4BITS(1,1,1,1,1,1,1,1), // 98 - 9f
50PCK4BITS(1,1,1,1,1,1,1,1), // a0 - a7
51PCK4BITS(1,1,1,1,1,1,1,1), // a8 - af
52PCK4BITS(1,1,1,1,1,1,1,1), // b0 - b7
53PCK4BITS(1,1,1,1,1,1,1,1), // b8 - bf
54PCK4BITS(1,1,1,1,1,1,1,1), // c0 - c7
55PCK4BITS(1,1,1,1,1,1,1,1), // c8 - cf
56PCK4BITS(1,1,1,1,1,1,1,1), // d0 - d7
57PCK4BITS(1,1,1,1,1,1,1,1), // d8 - df
58PCK4BITS(1,1,1,1,1,1,1,1), // e0 - e7
59PCK4BITS(1,1,1,1,1,1,1,1), // e8 - ef
60PCK4BITS(1,1,1,1,1,1,1,1), // f0 - f7
61PCK4BITS(1,1,1,1,1,1,1,1) // f8 - ff
62};
63
64
65static unsigned int HZ_st [ 6] = {
66PCK4BITS(eStart,eError, 3,eStart,eStart,eStart,eError,eError),//00-07
67PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
68PCK4BITS(eItsMe,eItsMe,eError,eError,eStart,eStart, 4,eError),//10-17
69PCK4BITS( 5,eError, 6,eError, 5, 5, 4,eError),//18-1f
70PCK4BITS( 4,eError, 4, 4, 4,eError, 4,eError),//20-27
71PCK4BITS( 4,eItsMe,eStart,eStart,eStart,eStart,eStart,eStart) //28-2f
72};
73
74static const unsigned int HZCharLenTable[] = {0, 0, 0, 0, 0, 0};
75
76SMModel HZSMModel = {
77 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, HZ_cls },
78 6,
79 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, HZ_st },
80 HZCharLenTable,
81 "HZ-GB-2312",
82};
83
84
85static unsigned int ISO2022CN_cls [ 256 / 8 ] = {
86PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
87PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
88PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
89PCK4BITS(0,0,0,1,0,0,0,0), // 18 - 1f
90PCK4BITS(0,0,0,0,0,0,0,0), // 20 - 27
91PCK4BITS(0,3,0,0,0,0,0,0), // 28 - 2f
92PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
93PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
94PCK4BITS(0,0,0,4,0,0,0,0), // 40 - 47
95PCK4BITS(0,0,0,0,0,0,0,0), // 48 - 4f
96PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
97PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
98PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
99PCK4BITS(0,0,0,0,0,0,0,0), // 68 - 6f
100PCK4BITS(0,0,0,0,0,0,0,0), // 70 - 77
101PCK4BITS(0,0,0,0,0,0,0,0), // 78 - 7f
102PCK4BITS(2,2,2,2,2,2,2,2), // 80 - 87
103PCK4BITS(2,2,2,2,2,2,2,2), // 88 - 8f
104PCK4BITS(2,2,2,2,2,2,2,2), // 90 - 97
105PCK4BITS(2,2,2,2,2,2,2,2), // 98 - 9f
106PCK4BITS(2,2,2,2,2,2,2,2), // a0 - a7
107PCK4BITS(2,2,2,2,2,2,2,2), // a8 - af
108PCK4BITS(2,2,2,2,2,2,2,2), // b0 - b7
109PCK4BITS(2,2,2,2,2,2,2,2), // b8 - bf
110PCK4BITS(2,2,2,2,2,2,2,2), // c0 - c7
111PCK4BITS(2,2,2,2,2,2,2,2), // c8 - cf
112PCK4BITS(2,2,2,2,2,2,2,2), // d0 - d7
113PCK4BITS(2,2,2,2,2,2,2,2), // d8 - df
114PCK4BITS(2,2,2,2,2,2,2,2), // e0 - e7
115PCK4BITS(2,2,2,2,2,2,2,2), // e8 - ef
116PCK4BITS(2,2,2,2,2,2,2,2), // f0 - f7
117PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
118};
119
120
121static unsigned int ISO2022CN_st [ 8] = {
122PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eStart,eStart),//00-07
123PCK4BITS(eStart,eError,eError,eError,eError,eError,eError,eError),//08-0f
124PCK4BITS(eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//10-17
125PCK4BITS(eItsMe,eItsMe,eItsMe,eError,eError,eError, 4,eError),//18-1f
126PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//20-27
127PCK4BITS( 5, 6,eError,eError,eError,eError,eError,eError),//28-2f
128PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//30-37
129PCK4BITS(eError,eError,eError,eError,eError,eItsMe,eError,eStart) //38-3f
130};
131
132static const unsigned int ISO2022CNCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
133
134SMModel ISO2022CNSMModel = {
135 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022CN_cls },
136 9,
137 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022CN_st },
138 ISO2022CNCharLenTable,
139 "ISO-2022-CN",
140};
141
142static unsigned int ISO2022JP_cls [ 256 / 8 ] = {
143PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
144PCK4BITS(0,0,0,0,0,0,2,2), // 08 - 0f
145PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
146PCK4BITS(0,0,0,1,0,0,0,0), // 18 - 1f
147PCK4BITS(0,0,0,0,7,0,0,0), // 20 - 27
148PCK4BITS(3,0,0,0,0,0,0,0), // 28 - 2f
149PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
150PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
151PCK4BITS(6,0,4,0,8,0,0,0), // 40 - 47
152PCK4BITS(0,9,5,0,0,0,0,0), // 48 - 4f
153PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
154PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
155PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
156PCK4BITS(0,0,0,0,0,0,0,0), // 68 - 6f
157PCK4BITS(0,0,0,0,0,0,0,0), // 70 - 77
158PCK4BITS(0,0,0,0,0,0,0,0), // 78 - 7f
159PCK4BITS(2,2,2,2,2,2,2,2), // 80 - 87
160PCK4BITS(2,2,2,2,2,2,2,2), // 88 - 8f
161PCK4BITS(2,2,2,2,2,2,2,2), // 90 - 97
162PCK4BITS(2,2,2,2,2,2,2,2), // 98 - 9f
163PCK4BITS(2,2,2,2,2,2,2,2), // a0 - a7
164PCK4BITS(2,2,2,2,2,2,2,2), // a8 - af
165PCK4BITS(2,2,2,2,2,2,2,2), // b0 - b7
166PCK4BITS(2,2,2,2,2,2,2,2), // b8 - bf
167PCK4BITS(2,2,2,2,2,2,2,2), // c0 - c7
168PCK4BITS(2,2,2,2,2,2,2,2), // c8 - cf
169PCK4BITS(2,2,2,2,2,2,2,2), // d0 - d7
170PCK4BITS(2,2,2,2,2,2,2,2), // d8 - df
171PCK4BITS(2,2,2,2,2,2,2,2), // e0 - e7
172PCK4BITS(2,2,2,2,2,2,2,2), // e8 - ef
173PCK4BITS(2,2,2,2,2,2,2,2), // f0 - f7
174PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
175};
176
177
178static unsigned int ISO2022JP_st [ 9] = {
179PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eStart,eStart),//00-07
180PCK4BITS(eStart,eStart,eError,eError,eError,eError,eError,eError),//08-0f
181PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//10-17
182PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError),//18-1f
183PCK4BITS(eError, 5,eError,eError,eError, 4,eError,eError),//20-27
184PCK4BITS(eError,eError,eError, 6,eItsMe,eError,eItsMe,eError),//28-2f
185PCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//30-37
186PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//38-3f
187PCK4BITS(eError,eError,eError,eError,eItsMe,eError,eStart,eStart) //40-47
188};
189
190static const unsigned int ISO2022JPCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0};
191
192SMModel ISO2022JPSMModel = {
193 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022JP_cls },
194 10,
195 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022JP_st },
196 ISO2022JPCharLenTable,
197 "ISO-2022-JP",
198};
199
200static unsigned int ISO2022KR_cls [ 256 / 8 ] = {
201PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
202PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
203PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
204PCK4BITS(0,0,0,1,0,0,0,0), // 18 - 1f
205PCK4BITS(0,0,0,0,3,0,0,0), // 20 - 27
206PCK4BITS(0,4,0,0,0,0,0,0), // 28 - 2f
207PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
208PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
209PCK4BITS(0,0,0,5,0,0,0,0), // 40 - 47
210PCK4BITS(0,0,0,0,0,0,0,0), // 48 - 4f
211PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
212PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
213PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
214PCK4BITS(0,0,0,0,0,0,0,0), // 68 - 6f
215PCK4BITS(0,0,0,0,0,0,0,0), // 70 - 77
216PCK4BITS(0,0,0,0,0,0,0,0), // 78 - 7f
217PCK4BITS(2,2,2,2,2,2,2,2), // 80 - 87
218PCK4BITS(2,2,2,2,2,2,2,2), // 88 - 8f
219PCK4BITS(2,2,2,2,2,2,2,2), // 90 - 97
220PCK4BITS(2,2,2,2,2,2,2,2), // 98 - 9f
221PCK4BITS(2,2,2,2,2,2,2,2), // a0 - a7
222PCK4BITS(2,2,2,2,2,2,2,2), // a8 - af
223PCK4BITS(2,2,2,2,2,2,2,2), // b0 - b7
224PCK4BITS(2,2,2,2,2,2,2,2), // b8 - bf
225PCK4BITS(2,2,2,2,2,2,2,2), // c0 - c7
226PCK4BITS(2,2,2,2,2,2,2,2), // c8 - cf
227PCK4BITS(2,2,2,2,2,2,2,2), // d0 - d7
228PCK4BITS(2,2,2,2,2,2,2,2), // d8 - df
229PCK4BITS(2,2,2,2,2,2,2,2), // e0 - e7
230PCK4BITS(2,2,2,2,2,2,2,2), // e8 - ef
231PCK4BITS(2,2,2,2,2,2,2,2), // f0 - f7
232PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
233};
234
235
236static unsigned int ISO2022KR_st [ 5] = {
237PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eError,eError),//00-07
238PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
239PCK4BITS(eItsMe,eItsMe,eError,eError,eError, 4,eError,eError),//10-17
240PCK4BITS(eError,eError,eError,eError, 5,eError,eError,eError),//18-1f
241PCK4BITS(eError,eError,eError,eItsMe,eStart,eStart,eStart,eStart) //20-27
242};
243
244static const unsigned int ISO2022KRCharLenTable[] = {0, 0, 0, 0, 0, 0};
245
246SMModel ISO2022KRSMModel = {
247 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022KR_cls },
248 6,
249 {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022KR_st },
250 ISO2022KRCharLenTable,
251 "ISO-2022-KR",
252};
253}
254
255
kencodingprober
Definition: CharDistribution.cpp:37
kencodingprober::ISO2022CN_st
static unsigned int ISO2022CN_st[8]
Definition: nsEscSM.cpp:121
kencodingprober::eBitSft4bits
@ eBitSft4bits
Definition: nsPkgInt.h:43
kencodingprober::ISO2022CNCharLenTable
static const unsigned int ISO2022CNCharLenTable[]
Definition: nsEscSM.cpp:132
kencodingprober::eIdxSft4bits
@ eIdxSft4bits
Definition: nsPkgInt.h:31
kencodingprober::ISO2022JPSMModel
KDE_NO_EXPORT SMModel ISO2022JPSMModel
Definition: nsEscSM.cpp:192
kencodingprober::ISO2022JP_st
static unsigned int ISO2022JP_st[9]
Definition: nsEscSM.cpp:178
kencodingprober::ISO2022JPCharLenTable
static const unsigned int ISO2022JPCharLenTable[]
Definition: nsEscSM.cpp:190
kencodingprober::HZCharLenTable
static const unsigned int HZCharLenTable[]
Definition: nsEscSM.cpp:74
kencodingprober::eUnitMsk4bits
@ eUnitMsk4bits
Definition: nsPkgInt.h:49
kencodingprober::ISO2022CN_cls
static unsigned int ISO2022CN_cls[256/8]
Definition: nsEscSM.cpp:85
kencodingprober::ISO2022JP_cls
static unsigned int ISO2022JP_cls[256/8]
Definition: nsEscSM.cpp:142
kencodingprober::HZ_st
static unsigned int HZ_st[6]
Definition: nsEscSM.cpp:65
kencodingprober::ISO2022KRSMModel
KDE_NO_EXPORT SMModel ISO2022KRSMModel
Definition: nsEscSM.cpp:246
kencodingprober::ISO2022KRCharLenTable
static const unsigned int ISO2022KRCharLenTable[]
Definition: nsEscSM.cpp:244
kencodingprober::eSftMsk4bits
@ eSftMsk4bits
Definition: nsPkgInt.h:37
kencodingprober::ISO2022KR_cls
static unsigned int ISO2022KR_cls[256/8]
Definition: nsEscSM.cpp:200
kencodingprober::ISO2022KR_st
static unsigned int ISO2022KR_st[5]
Definition: nsEscSM.cpp:236
kencodingprober::HZSMModel
KDE_NO_EXPORT SMModel HZSMModel
Definition: nsEscSM.cpp:76
kencodingprober::eItsMe
@ eItsMe
Definition: nsCodingStateMachine.h:38
kencodingprober::eError
@ eError
Definition: nsCodingStateMachine.h:37
kencodingprober::eStart
@ eStart
Definition: nsCodingStateMachine.h:36
kencodingprober::HZ_cls
static unsigned int HZ_cls[256/8]
Definition: nsEscSM.cpp:29
kencodingprober::ISO2022CNSMModel
KDE_NO_EXPORT SMModel ISO2022CNSMModel
Definition: nsEscSM.cpp:134
nsCodingStateMachine.h
PCK4BITS
#define PCK4BITS(a, b, c, d, e, f, g, h)
Definition: nsPkgInt.h:68
kencodingprober::SMModel
Definition: nsCodingStateMachine.h:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal