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

KDECore

  • sources
  • kde-4.12
  • kdelibs
  • 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 
28 namespace kencodingprober {
29 static unsigned int HZ_cls[ 256 / 8 ] = {
30 PCK4BITS(1,0,0,0,0,0,0,0), // 00 - 07
31 PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
32 PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
33 PCK4BITS(0,0,0,1,0,0,0,0), // 18 - 1f
34 PCK4BITS(0,0,0,0,0,0,0,0), // 20 - 27
35 PCK4BITS(0,0,0,0,0,0,0,0), // 28 - 2f
36 PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
37 PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
38 PCK4BITS(0,0,0,0,0,0,0,0), // 40 - 47
39 PCK4BITS(0,0,0,0,0,0,0,0), // 48 - 4f
40 PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
41 PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
42 PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
43 PCK4BITS(0,0,0,0,0,0,0,0), // 68 - 6f
44 PCK4BITS(0,0,0,0,0,0,0,0), // 70 - 77
45 PCK4BITS(0,0,0,4,0,5,2,0), // 78 - 7f
46 PCK4BITS(1,1,1,1,1,1,1,1), // 80 - 87
47 PCK4BITS(1,1,1,1,1,1,1,1), // 88 - 8f
48 PCK4BITS(1,1,1,1,1,1,1,1), // 90 - 97
49 PCK4BITS(1,1,1,1,1,1,1,1), // 98 - 9f
50 PCK4BITS(1,1,1,1,1,1,1,1), // a0 - a7
51 PCK4BITS(1,1,1,1,1,1,1,1), // a8 - af
52 PCK4BITS(1,1,1,1,1,1,1,1), // b0 - b7
53 PCK4BITS(1,1,1,1,1,1,1,1), // b8 - bf
54 PCK4BITS(1,1,1,1,1,1,1,1), // c0 - c7
55 PCK4BITS(1,1,1,1,1,1,1,1), // c8 - cf
56 PCK4BITS(1,1,1,1,1,1,1,1), // d0 - d7
57 PCK4BITS(1,1,1,1,1,1,1,1), // d8 - df
58 PCK4BITS(1,1,1,1,1,1,1,1), // e0 - e7
59 PCK4BITS(1,1,1,1,1,1,1,1), // e8 - ef
60 PCK4BITS(1,1,1,1,1,1,1,1), // f0 - f7
61 PCK4BITS(1,1,1,1,1,1,1,1) // f8 - ff
62 };
63 
64 
65 static unsigned int HZ_st [ 6] = {
66 PCK4BITS(eStart,eError, 3,eStart,eStart,eStart,eError,eError),//00-07
67 PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
68 PCK4BITS(eItsMe,eItsMe,eError,eError,eStart,eStart, 4,eError),//10-17
69 PCK4BITS( 5,eError, 6,eError, 5, 5, 4,eError),//18-1f
70 PCK4BITS( 4,eError, 4, 4, 4,eError, 4,eError),//20-27
71 PCK4BITS( 4,eItsMe,eStart,eStart,eStart,eStart,eStart,eStart) //28-2f
72 };
73 
74 static const unsigned int HZCharLenTable[] = {0, 0, 0, 0, 0, 0};
75 
76 SMModel 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 
85 static unsigned int ISO2022CN_cls [ 256 / 8 ] = {
86 PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
87 PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
88 PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
89 PCK4BITS(0,0,0,1,0,0,0,0), // 18 - 1f
90 PCK4BITS(0,0,0,0,0,0,0,0), // 20 - 27
91 PCK4BITS(0,3,0,0,0,0,0,0), // 28 - 2f
92 PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
93 PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
94 PCK4BITS(0,0,0,4,0,0,0,0), // 40 - 47
95 PCK4BITS(0,0,0,0,0,0,0,0), // 48 - 4f
96 PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
97 PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
98 PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
99 PCK4BITS(0,0,0,0,0,0,0,0), // 68 - 6f
100 PCK4BITS(0,0,0,0,0,0,0,0), // 70 - 77
101 PCK4BITS(0,0,0,0,0,0,0,0), // 78 - 7f
102 PCK4BITS(2,2,2,2,2,2,2,2), // 80 - 87
103 PCK4BITS(2,2,2,2,2,2,2,2), // 88 - 8f
104 PCK4BITS(2,2,2,2,2,2,2,2), // 90 - 97
105 PCK4BITS(2,2,2,2,2,2,2,2), // 98 - 9f
106 PCK4BITS(2,2,2,2,2,2,2,2), // a0 - a7
107 PCK4BITS(2,2,2,2,2,2,2,2), // a8 - af
108 PCK4BITS(2,2,2,2,2,2,2,2), // b0 - b7
109 PCK4BITS(2,2,2,2,2,2,2,2), // b8 - bf
110 PCK4BITS(2,2,2,2,2,2,2,2), // c0 - c7
111 PCK4BITS(2,2,2,2,2,2,2,2), // c8 - cf
112 PCK4BITS(2,2,2,2,2,2,2,2), // d0 - d7
113 PCK4BITS(2,2,2,2,2,2,2,2), // d8 - df
114 PCK4BITS(2,2,2,2,2,2,2,2), // e0 - e7
115 PCK4BITS(2,2,2,2,2,2,2,2), // e8 - ef
116 PCK4BITS(2,2,2,2,2,2,2,2), // f0 - f7
117 PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
118 };
119 
120 
121 static unsigned int ISO2022CN_st [ 8] = {
122 PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eStart,eStart),//00-07
123 PCK4BITS(eStart,eError,eError,eError,eError,eError,eError,eError),//08-0f
124 PCK4BITS(eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//10-17
125 PCK4BITS(eItsMe,eItsMe,eItsMe,eError,eError,eError, 4,eError),//18-1f
126 PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//20-27
127 PCK4BITS( 5, 6,eError,eError,eError,eError,eError,eError),//28-2f
128 PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//30-37
129 PCK4BITS(eError,eError,eError,eError,eError,eItsMe,eError,eStart) //38-3f
130 };
131 
132 static const unsigned int ISO2022CNCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
133 
134 SMModel 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 
142 static unsigned int ISO2022JP_cls [ 256 / 8 ] = {
143 PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
144 PCK4BITS(0,0,0,0,0,0,2,2), // 08 - 0f
145 PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
146 PCK4BITS(0,0,0,1,0,0,0,0), // 18 - 1f
147 PCK4BITS(0,0,0,0,7,0,0,0), // 20 - 27
148 PCK4BITS(3,0,0,0,0,0,0,0), // 28 - 2f
149 PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
150 PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
151 PCK4BITS(6,0,4,0,8,0,0,0), // 40 - 47
152 PCK4BITS(0,9,5,0,0,0,0,0), // 48 - 4f
153 PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
154 PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
155 PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
156 PCK4BITS(0,0,0,0,0,0,0,0), // 68 - 6f
157 PCK4BITS(0,0,0,0,0,0,0,0), // 70 - 77
158 PCK4BITS(0,0,0,0,0,0,0,0), // 78 - 7f
159 PCK4BITS(2,2,2,2,2,2,2,2), // 80 - 87
160 PCK4BITS(2,2,2,2,2,2,2,2), // 88 - 8f
161 PCK4BITS(2,2,2,2,2,2,2,2), // 90 - 97
162 PCK4BITS(2,2,2,2,2,2,2,2), // 98 - 9f
163 PCK4BITS(2,2,2,2,2,2,2,2), // a0 - a7
164 PCK4BITS(2,2,2,2,2,2,2,2), // a8 - af
165 PCK4BITS(2,2,2,2,2,2,2,2), // b0 - b7
166 PCK4BITS(2,2,2,2,2,2,2,2), // b8 - bf
167 PCK4BITS(2,2,2,2,2,2,2,2), // c0 - c7
168 PCK4BITS(2,2,2,2,2,2,2,2), // c8 - cf
169 PCK4BITS(2,2,2,2,2,2,2,2), // d0 - d7
170 PCK4BITS(2,2,2,2,2,2,2,2), // d8 - df
171 PCK4BITS(2,2,2,2,2,2,2,2), // e0 - e7
172 PCK4BITS(2,2,2,2,2,2,2,2), // e8 - ef
173 PCK4BITS(2,2,2,2,2,2,2,2), // f0 - f7
174 PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
175 };
176 
177 
178 static unsigned int ISO2022JP_st [ 9] = {
179 PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eStart,eStart),//00-07
180 PCK4BITS(eStart,eStart,eError,eError,eError,eError,eError,eError),//08-0f
181 PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//10-17
182 PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError),//18-1f
183 PCK4BITS(eError, 5,eError,eError,eError, 4,eError,eError),//20-27
184 PCK4BITS(eError,eError,eError, 6,eItsMe,eError,eItsMe,eError),//28-2f
185 PCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//30-37
186 PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//38-3f
187 PCK4BITS(eError,eError,eError,eError,eItsMe,eError,eStart,eStart) //40-47
188 };
189 
190 static const unsigned int ISO2022JPCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0};
191 
192 SMModel 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 
200 static unsigned int ISO2022KR_cls [ 256 / 8 ] = {
201 PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
202 PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
203 PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
204 PCK4BITS(0,0,0,1,0,0,0,0), // 18 - 1f
205 PCK4BITS(0,0,0,0,3,0,0,0), // 20 - 27
206 PCK4BITS(0,4,0,0,0,0,0,0), // 28 - 2f
207 PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
208 PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
209 PCK4BITS(0,0,0,5,0,0,0,0), // 40 - 47
210 PCK4BITS(0,0,0,0,0,0,0,0), // 48 - 4f
211 PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
212 PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
213 PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
214 PCK4BITS(0,0,0,0,0,0,0,0), // 68 - 6f
215 PCK4BITS(0,0,0,0,0,0,0,0), // 70 - 77
216 PCK4BITS(0,0,0,0,0,0,0,0), // 78 - 7f
217 PCK4BITS(2,2,2,2,2,2,2,2), // 80 - 87
218 PCK4BITS(2,2,2,2,2,2,2,2), // 88 - 8f
219 PCK4BITS(2,2,2,2,2,2,2,2), // 90 - 97
220 PCK4BITS(2,2,2,2,2,2,2,2), // 98 - 9f
221 PCK4BITS(2,2,2,2,2,2,2,2), // a0 - a7
222 PCK4BITS(2,2,2,2,2,2,2,2), // a8 - af
223 PCK4BITS(2,2,2,2,2,2,2,2), // b0 - b7
224 PCK4BITS(2,2,2,2,2,2,2,2), // b8 - bf
225 PCK4BITS(2,2,2,2,2,2,2,2), // c0 - c7
226 PCK4BITS(2,2,2,2,2,2,2,2), // c8 - cf
227 PCK4BITS(2,2,2,2,2,2,2,2), // d0 - d7
228 PCK4BITS(2,2,2,2,2,2,2,2), // d8 - df
229 PCK4BITS(2,2,2,2,2,2,2,2), // e0 - e7
230 PCK4BITS(2,2,2,2,2,2,2,2), // e8 - ef
231 PCK4BITS(2,2,2,2,2,2,2,2), // f0 - f7
232 PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
233 };
234 
235 
236 static unsigned int ISO2022KR_st [ 5] = {
237 PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eError,eError),//00-07
238 PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
239 PCK4BITS(eItsMe,eItsMe,eError,eError,eError, 4,eError,eError),//10-17
240 PCK4BITS(eError,eError,eError,eError, 5,eError,eError,eError),//18-1f
241 PCK4BITS(eError,eError,eError,eItsMe,eStart,eStart,eStart,eStart) //20-27
242 };
243 
244 static const unsigned int ISO2022KRCharLenTable[] = {0, 0, 0, 0, 0, 0};
245 
246 SMModel 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::SMModel
Definition: nsCodingStateMachine.h:44
kencodingprober::eUnitMsk4bits
Definition: nsPkgInt.h:49
kencodingprober::ISO2022KRSMModel
KDE_NO_EXPORT SMModel ISO2022KRSMModel
Definition: nsEscSM.cpp:246
kencodingprober::HZSMModel
KDE_NO_EXPORT SMModel HZSMModel
Definition: nsEscSM.cpp:76
kencodingprober::ISO2022CN_cls
static unsigned int ISO2022CN_cls[256/8]
Definition: nsEscSM.cpp:85
kencodingprober::HZ_cls
static unsigned int HZ_cls[256/8]
Definition: nsEscSM.cpp:29
kencodingprober::ISO2022JPCharLenTable
static const unsigned int ISO2022JPCharLenTable[]
Definition: nsEscSM.cpp:190
kencodingprober::ISO2022CNCharLenTable
static const unsigned int ISO2022CNCharLenTable[]
Definition: nsEscSM.cpp:132
kencodingprober::HZ_st
static unsigned int HZ_st[6]
Definition: nsEscSM.cpp:65
kencodingprober::ISO2022CN_st
static unsigned int ISO2022CN_st[8]
Definition: nsEscSM.cpp:121
kencodingprober::eError
Definition: nsCodingStateMachine.h:37
nsCodingStateMachine.h
kencodingprober::ISO2022JPSMModel
KDE_NO_EXPORT SMModel ISO2022JPSMModel
Definition: nsEscSM.cpp:192
kencodingprober::ISO2022JP_cls
static unsigned int ISO2022JP_cls[256/8]
Definition: nsEscSM.cpp:142
kencodingprober::ISO2022KR_st
static unsigned int ISO2022KR_st[5]
Definition: nsEscSM.cpp:236
kencodingprober::ISO2022CNSMModel
KDE_NO_EXPORT SMModel ISO2022CNSMModel
Definition: nsEscSM.cpp:134
kencodingprober::eIdxSft4bits
Definition: nsPkgInt.h:31
PCK4BITS
#define PCK4BITS(a, b, c, d, e, f, g, h)
Definition: nsPkgInt.h:68
kencodingprober::HZCharLenTable
static const unsigned int HZCharLenTable[]
Definition: nsEscSM.cpp:74
kencodingprober::eSftMsk4bits
Definition: nsPkgInt.h:37
kencodingprober::ISO2022KRCharLenTable
static const unsigned int ISO2022KRCharLenTable[]
Definition: nsEscSM.cpp:244
kencodingprober::eItsMe
Definition: nsCodingStateMachine.h:38
kencodingprober::eStart
Definition: nsCodingStateMachine.h:36
kencodingprober::ISO2022KR_cls
static unsigned int ISO2022KR_cls[256/8]
Definition: nsEscSM.cpp:200
kencodingprober::eBitSft4bits
Definition: nsPkgInt.h:43
kencodingprober::ISO2022JP_st
static unsigned int ISO2022JP_st[9]
Definition: nsEscSM.cpp:178
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:09 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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