1 /* |
1 /* |
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: This file is a source code file for a charconv plug-in. |
14 * Description: This file is a source code file for a charconv plug-in. |
15 |
|
16 * This plug-in supports EUC-JP with direct mapped pictograph. |
15 * This plug-in supports EUC-JP with direct mapped pictograph. |
17 |
|
18 * |
16 * |
19 */ |
17 */ |
20 |
18 |
21 |
19 |
22 |
20 |
23 |
21 |
24 |
|
25 |
|
26 // INCLUDE FILES |
22 // INCLUDE FILES |
27 |
|
28 #include <e32std.h> |
23 #include <e32std.h> |
29 |
|
30 #include <charconv.h> |
24 #include <charconv.h> |
31 |
25 |
32 |
|
33 |
|
34 #ifndef EKA2 |
26 #ifndef EKA2 |
35 |
|
36 #include <CONVPLUG.H> |
27 #include <CONVPLUG.H> |
37 |
|
38 #else |
28 #else |
39 |
|
40 #include <convgeneratedcpp.h> |
29 #include <convgeneratedcpp.h> |
41 |
|
42 #include <ecom/implementationproxy.h> |
30 #include <ecom/implementationproxy.h> |
43 |
|
44 #include "charactersetconverter.h" |
31 #include "charactersetconverter.h" |
45 |
|
46 #endif // !EKA2 |
32 #endif // !EKA2 |
47 |
33 |
48 |
|
49 |
|
50 #include <convutils.h> |
34 #include <convutils.h> |
51 |
|
52 #include <jisx0201.h> |
35 #include <jisx0201.h> |
53 |
|
54 #include <jisx0208.h> |
36 #include <jisx0208.h> |
55 |
|
56 #include <jisx0212.h> |
37 #include <jisx0212.h> |
57 |
|
58 #include <CnvShiftJisDirectmap.h> |
38 #include <CnvShiftJisDirectmap.h> |
59 |
|
60 // LOCAL CONSTANTS AND MACROS |
39 // LOCAL CONSTANTS AND MACROS |
61 |
|
62 const TUint KSingleShift2=0x8e; |
40 const TUint KSingleShift2=0x8e; |
63 |
|
64 const TUint KSingleShift3=0x8f; |
41 const TUint KSingleShift3=0x8f; |
65 |
|
66 const TUint KFirstByteRangeFirstBlockStart = 0xF5; |
42 const TUint KFirstByteRangeFirstBlockStart = 0xF5; |
67 |
|
68 const TUint KFirstByteRangeFirstBlockEnd = 0xFE; |
43 const TUint KFirstByteRangeFirstBlockEnd = 0xFE; |
69 |
|
70 const TUint KSecondByteRangeSecondBlockStart = 0xA1; |
44 const TUint KSecondByteRangeSecondBlockStart = 0xA1; |
71 |
|
72 const TUint KSecondByteRangeSecondBlockEnd = 0xFE; |
45 const TUint KSecondByteRangeSecondBlockEnd = 0xFE; |
73 |
|
74 const TUint KPictographStartFirstByte = 0xF0; |
46 const TUint KPictographStartFirstByte = 0xF0; |
75 |
|
76 const TUint KPictographStartSecondByte = 0x40; |
47 const TUint KPictographStartSecondByte = 0x40; |
77 |
|
78 const TUint KEUCJPSecondBlockStart = 0xF5; |
48 const TUint KEUCJPSecondBlockStart = 0xF5; |
79 |
|
80 const TUint KEUCJPBlockSize = 0x5D; |
49 const TUint KEUCJPBlockSize = 0x5D; |
81 |
|
82 const TUint KShiftJisTrailByteIllegal = 0x7F; |
50 const TUint KShiftJisTrailByteIllegal = 0x7F; |
83 |
51 |
84 |
|
85 |
|
86 // SecureID for Brower app |
52 // SecureID for Brower app |
87 |
|
88 const TUint32 KBrowserSecureId = 0x10008D39; |
53 const TUint32 KBrowserSecureId = 0x10008D39; |
89 |
|
90 // Define for converting from YenSign to BackSlash |
54 // Define for converting from YenSign to BackSlash |
91 |
|
92 const TUint KCharacterCodeForYenSign = 0x00A5; |
55 const TUint KCharacterCodeForYenSign = 0x00A5; |
93 |
|
94 const TUint KCharacterCodeForBackSlash = 0x005C; |
56 const TUint KCharacterCodeForBackSlash = 0x005C; |
95 |
57 |
96 |
|
97 |
|
98 // fullwidth question mark |
58 // fullwidth question mark |
99 |
|
100 _LIT8(KLit8EucJpPackedReplacementForUnconvertibleUnicodeCharacters, "\xa1\xa9"); |
59 _LIT8(KLit8EucJpPackedReplacementForUnconvertibleUnicodeCharacters, "\xa1\xa9"); |
101 |
|
102 #if defined(_DEBUG) |
60 #if defined(_DEBUG) |
103 |
|
104 _LIT(KLitPanicText, "EucJpDirectmap"); |
61 _LIT(KLitPanicText, "EucJpDirectmap"); |
105 |
|
106 enum TPanic |
62 enum TPanic |
107 |
63 { |
108 { |
|
109 |
|
110 EPanicNothingToConvert1=1, |
64 EPanicNothingToConvert1=1, |
111 |
|
112 EPanicNothingToConvert2, |
65 EPanicNothingToConvert2, |
113 |
|
114 EPanicNothingToConvert3, |
66 EPanicNothingToConvert3, |
115 |
|
116 EPanicNothingToConvert4, |
67 EPanicNothingToConvert4, |
117 |
|
118 EPanicNothingToConvert5, |
68 EPanicNothingToConvert5, |
119 |
|
120 EPanicNothingToConvert6, |
69 EPanicNothingToConvert6, |
121 |
|
122 EPanicOddNumberOfBytes1, |
70 EPanicOddNumberOfBytes1, |
123 |
|
124 EPanicOddNumberOfBytes2, |
71 EPanicOddNumberOfBytes2, |
125 |
|
126 EPanicOddNumberOfBytes3, |
72 EPanicOddNumberOfBytes3, |
127 |
|
128 EPanicOddNumberOfBytes4, |
73 EPanicOddNumberOfBytes4, |
129 |
|
130 EPanicOddNumberOfBytes5, |
74 EPanicOddNumberOfBytes5, |
131 |
|
132 EPanicOddNumberOfBytes6, |
75 EPanicOddNumberOfBytes6, |
133 |
|
134 EPanicBadHighBit1, |
76 EPanicBadHighBit1, |
135 |
|
136 EPanicBadHighBit2, |
77 EPanicBadHighBit2, |
137 |
|
138 EPanicBadHighBit3, |
78 EPanicBadHighBit3, |
139 |
|
140 EPanicBadHighBit4, |
79 EPanicBadHighBit4, |
141 |
|
142 EPanicBadHighBit5, |
80 EPanicBadHighBit5, |
143 |
|
144 EPanicBadHighBit6, |
81 EPanicBadHighBit6, |
145 |
|
146 EPanicBadHighBit7, |
82 EPanicBadHighBit7, |
147 |
|
148 EPanicBadPointers1, |
83 EPanicBadPointers1, |
149 |
|
150 EPanicBadPointers2, |
84 EPanicBadPointers2, |
151 |
|
152 EPanicBadPointers3, |
85 EPanicBadPointers3, |
153 |
|
154 EPanicBadPointers4, |
86 EPanicBadPointers4, |
155 |
|
156 EPanicBadPointers5, |
87 EPanicBadPointers5, |
157 |
|
158 EPanicBadPointers6, |
88 EPanicBadPointers6, |
159 |
|
160 EPanicBadPointers7, |
89 EPanicBadPointers7, |
161 |
|
162 EPanicBadPointers8, |
90 EPanicBadPointers8, |
163 |
|
164 EPanicBadPointers9, |
91 EPanicBadPointers9, |
165 |
|
166 EPanicBadPointers10, |
92 EPanicBadPointers10, |
167 |
|
168 EPanicBadPointers11, |
93 EPanicBadPointers11, |
169 |
|
170 EPanicBadPointers12, |
94 EPanicBadPointers12, |
171 |
|
172 EPanicBadPointers13, |
95 EPanicBadPointers13, |
173 |
|
174 EPanicBadPointers14, |
96 EPanicBadPointers14, |
175 |
|
176 EPanicBadPointers15, |
97 EPanicBadPointers15, |
177 |
|
178 EPanicBadPointers16, |
98 EPanicBadPointers16, |
179 |
|
180 EPanicBadPointers17, |
99 EPanicBadPointers17, |
181 |
|
182 EPanicBadPointers18, |
100 EPanicBadPointers18, |
183 |
|
184 EPanicBadPointers19, |
101 EPanicBadPointers19, |
185 |
|
186 EPanicBadPointers20, |
102 EPanicBadPointers20, |
187 |
|
188 EPanicBadPointers21, |
103 EPanicBadPointers21, |
189 |
|
190 EPanicBadPointers22, |
104 EPanicBadPointers22, |
191 |
|
192 EPanicBadPointers23, |
105 EPanicBadPointers23, |
193 |
|
194 EPanicBadPointers24, |
106 EPanicBadPointers24, |
195 |
|
196 EPanicBadPointers25, |
107 EPanicBadPointers25, |
197 |
|
198 EPanicBadPointers26, |
108 EPanicBadPointers26, |
199 |
|
200 EPanicBadPointers27, |
109 EPanicBadPointers27, |
201 |
|
202 EPanicBadPointers28, |
110 EPanicBadPointers28, |
203 |
|
204 EPanicBadPointers29, |
111 EPanicBadPointers29, |
205 |
|
206 EPanicBadPointers30, |
112 EPanicBadPointers30, |
207 |
|
208 EPanicBadPointers31, |
113 EPanicBadPointers31, |
209 |
|
210 EPanicBadPointers32, |
114 EPanicBadPointers32, |
211 |
|
212 EPanicBadPointers33, |
115 EPanicBadPointers33, |
213 |
|
214 EPanicBadPointers34, |
116 EPanicBadPointers34, |
215 |
|
216 EPanicBadPointers35, |
117 EPanicBadPointers35, |
217 |
|
218 EPanicBadPointers36, |
118 EPanicBadPointers36, |
219 |
|
220 EPanicBadCalculation1, |
119 EPanicBadCalculation1, |
221 |
|
222 EPanicBadCalculation2, |
120 EPanicBadCalculation2, |
223 |
|
224 EPanicNumberOfBytesIsNotMultipleOfThree1, |
121 EPanicNumberOfBytesIsNotMultipleOfThree1, |
225 |
|
226 EPanicNumberOfBytesIsNotMultipleOfThree2, |
122 EPanicNumberOfBytesIsNotMultipleOfThree2, |
227 |
|
228 EPanicSingleShift2Expected, |
123 EPanicSingleShift2Expected, |
229 |
|
230 EPanicSingleShift3Expected |
124 EPanicSingleShift3Expected |
231 |
|
232 }; |
125 }; |
233 |
126 |
234 |
|
235 |
|
236 LOCAL_C void Panic(TPanic aPanic) |
127 LOCAL_C void Panic(TPanic aPanic) |
237 |
128 { |
238 { |
|
239 |
|
240 User::Panic(KLitPanicText, aPanic); |
129 User::Panic(KLitPanicText, aPanic); |
241 |
130 } |
242 } |
|
243 |
|
244 #endif |
131 #endif |
245 |
132 |
246 |
133 // ----------------------------------------------------------------------------- |
247 |
|
248 // ----------------------------------------------------------------------------- |
|
249 |
|
250 // DummyConvertFromIntermediateBufferInPlace |
134 // DummyConvertFromIntermediateBufferInPlace |
251 |
135 // |
252 // |
136 // ----------------------------------------------------------------------------- |
253 |
137 // |
254 // ----------------------------------------------------------------------------- |
|
255 |
|
256 // |
|
257 |
|
258 LOCAL_C void DummyConvertFromIntermediateBufferInPlace(TInt, TDes8&, |
138 LOCAL_C void DummyConvertFromIntermediateBufferInPlace(TInt, TDes8&, |
259 |
|
260 TInt& aNumberOfCharactersThatDroppedOut) |
139 TInt& aNumberOfCharactersThatDroppedOut) |
261 |
140 { |
262 { |
|
263 |
|
264 aNumberOfCharactersThatDroppedOut = 0; |
141 aNumberOfCharactersThatDroppedOut = 0; |
265 |
142 } |
266 } |
143 |
267 |
144 // ----------------------------------------------------------------------------- |
268 |
|
269 |
|
270 // ----------------------------------------------------------------------------- |
|
271 |
|
272 // ConvertFromJisX0208ToEucJpPackedInPlace |
145 // ConvertFromJisX0208ToEucJpPackedInPlace |
273 |
|
274 // Converts from JIS code to EUC-JP |
146 // Converts from JIS code to EUC-JP |
275 |
147 // ----------------------------------------------------------------------------- |
276 // ----------------------------------------------------------------------------- |
148 // |
277 |
|
278 // |
|
279 |
|
280 LOCAL_C void ConvertFromJisX0208ToEucJpPackedInPlace( |
149 LOCAL_C void ConvertFromJisX0208ToEucJpPackedInPlace( |
281 |
|
282 TInt aStartPositionInDescriptor, TDes8& aDescriptor, |
150 TInt aStartPositionInDescriptor, TDes8& aDescriptor, |
283 |
|
284 TInt& aNumberOfCharactersThatDroppedOut) |
151 TInt& aNumberOfCharactersThatDroppedOut) |
285 |
152 { |
286 { |
|
287 |
|
288 aNumberOfCharactersThatDroppedOut = 0; |
153 aNumberOfCharactersThatDroppedOut = 0; |
289 |
|
290 const TInt descriptorLength = aDescriptor.Length(); |
154 const TInt descriptorLength = aDescriptor.Length(); |
291 |
|
292 __ASSERT_DEBUG(descriptorLength > aStartPositionInDescriptor, |
155 __ASSERT_DEBUG(descriptorLength > aStartPositionInDescriptor, |
293 |
|
294 Panic(EPanicNothingToConvert1)); |
156 Panic(EPanicNothingToConvert1)); |
295 |
|
296 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
157 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
297 |
|
298 Panic(EPanicOddNumberOfBytes1)); |
158 Panic(EPanicOddNumberOfBytes1)); |
299 |
|
300 TUint8* pointerToCurrentByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
159 TUint8* pointerToCurrentByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
301 |
|
302 const TUint8* const pointerToLastByte = |
160 const TUint8* const pointerToLastByte = |
303 |
|
304 pointerToCurrentByte + (descriptorLength - 1); |
161 pointerToCurrentByte + (descriptorLength - 1); |
305 |
|
306 pointerToCurrentByte += aStartPositionInDescriptor; |
162 pointerToCurrentByte += aStartPositionInDescriptor; |
307 |
|
308 FOREVER |
163 FOREVER |
309 |
164 { |
310 { |
|
311 |
|
312 const TUint currentByte = *pointerToCurrentByte; |
165 const TUint currentByte = *pointerToCurrentByte; |
313 |
|
314 __ASSERT_DEBUG((currentByte & 0x80) == 0, Panic(EPanicBadHighBit1)); |
166 __ASSERT_DEBUG((currentByte & 0x80) == 0, Panic(EPanicBadHighBit1)); |
315 |
|
316 *pointerToCurrentByte = STATIC_CAST(TUint8, currentByte | 0x80); |
167 *pointerToCurrentByte = STATIC_CAST(TUint8, currentByte | 0x80); |
317 |
|
318 __ASSERT_DEBUG(pointerToCurrentByte <= pointerToLastByte, |
168 __ASSERT_DEBUG(pointerToCurrentByte <= pointerToLastByte, |
319 |
|
320 Panic(EPanicBadPointers1)); |
169 Panic(EPanicBadPointers1)); |
321 |
|
322 if (pointerToCurrentByte >= pointerToLastByte) |
170 if (pointerToCurrentByte >= pointerToLastByte) |
323 |
171 { |
324 { |
172 break; |
325 |
173 } |
326 break; |
|
327 |
|
328 } |
|
329 |
|
330 ++pointerToCurrentByte; |
174 ++pointerToCurrentByte; |
331 |
175 } |
332 } |
176 } |
333 |
177 |
334 } |
178 // ----------------------------------------------------------------------------- |
335 |
|
336 |
|
337 |
|
338 // ----------------------------------------------------------------------------- |
|
339 |
|
340 // ConvertFromHalfWidthKatakana8ToEucJpPackedInPlace |
179 // ConvertFromHalfWidthKatakana8ToEucJpPackedInPlace |
341 |
|
342 // Converts from half width Katakana code to EUC-JP |
180 // Converts from half width Katakana code to EUC-JP |
343 |
181 // ----------------------------------------------------------------------------- |
344 // ----------------------------------------------------------------------------- |
182 // |
345 |
|
346 // |
|
347 |
|
348 LOCAL_C void ConvertFromHalfWidthKatakana8ToEucJpPackedInPlace( |
183 LOCAL_C void ConvertFromHalfWidthKatakana8ToEucJpPackedInPlace( |
349 |
|
350 TInt aStartPositionInDescriptor, TDes8& aDescriptor, |
184 TInt aStartPositionInDescriptor, TDes8& aDescriptor, |
351 |
|
352 TInt& aNumberOfCharactersThatDroppedOut) |
185 TInt& aNumberOfCharactersThatDroppedOut) |
353 |
186 { |
354 { |
|
355 |
|
356 TInt descriptorLength = aDescriptor.Length(); |
187 TInt descriptorLength = aDescriptor.Length(); |
357 |
|
358 __ASSERT_DEBUG(descriptorLength > aStartPositionInDescriptor, |
188 __ASSERT_DEBUG(descriptorLength > aStartPositionInDescriptor, |
359 |
|
360 Panic(EPanicNothingToConvert2)); |
189 Panic(EPanicNothingToConvert2)); |
361 |
|
362 aNumberOfCharactersThatDroppedOut = Max(0, (descriptorLength - |
190 aNumberOfCharactersThatDroppedOut = Max(0, (descriptorLength - |
363 |
|
364 aStartPositionInDescriptor) - ((aDescriptor.MaxLength() - |
191 aStartPositionInDescriptor) - ((aDescriptor.MaxLength() - |
365 |
|
366 aStartPositionInDescriptor) / 2)); |
192 aStartPositionInDescriptor) / 2)); |
367 |
|
368 descriptorLength -= aNumberOfCharactersThatDroppedOut; |
193 descriptorLength -= aNumberOfCharactersThatDroppedOut; |
369 |
|
370 __ASSERT_DEBUG(descriptorLength >= aStartPositionInDescriptor, |
194 __ASSERT_DEBUG(descriptorLength >= aStartPositionInDescriptor, |
371 |
|
372 Panic(EPanicBadCalculation1)); |
195 Panic(EPanicBadCalculation1)); |
373 |
|
374 if (descriptorLength <= aStartPositionInDescriptor) |
196 if (descriptorLength <= aStartPositionInDescriptor) |
375 |
197 { |
376 { |
|
377 |
|
378 aDescriptor.SetLength(descriptorLength); |
198 aDescriptor.SetLength(descriptorLength); |
379 |
199 } |
380 } |
|
381 |
|
382 else |
200 else |
383 |
201 { |
384 { |
|
385 |
|
386 // pointerToTargetByte is initialized properly when descriptorLength |
202 // pointerToTargetByte is initialized properly when descriptorLength |
387 |
|
388 // has been offset to the actual final length of aDescriptor |
203 // has been offset to the actual final length of aDescriptor |
389 |
|
390 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
204 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
391 |
|
392 const TUint8* const pointerToFirstByte = |
205 const TUint8* const pointerToFirstByte = |
393 |
|
394 pointerToTargetByte + aStartPositionInDescriptor; |
206 pointerToTargetByte + aStartPositionInDescriptor; |
395 |
|
396 const TUint8* pointerToSourceByte = |
207 const TUint8* pointerToSourceByte = |
397 |
|
398 pointerToTargetByte + (descriptorLength - 1); |
208 pointerToTargetByte + (descriptorLength - 1); |
399 |
|
400 descriptorLength = |
209 descriptorLength = |
401 |
|
402 ((descriptorLength - aStartPositionInDescriptor) * 2) + |
210 ((descriptorLength - aStartPositionInDescriptor) * 2) + |
403 |
|
404 aStartPositionInDescriptor; |
211 aStartPositionInDescriptor; |
405 |
|
406 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
212 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
407 |
|
408 Panic(EPanicOddNumberOfBytes2)); |
213 Panic(EPanicOddNumberOfBytes2)); |
409 |
|
410 aDescriptor.SetLength(descriptorLength); |
214 aDescriptor.SetLength(descriptorLength); |
411 |
|
412 // pointerToTargetByte is is initialized properly here |
215 // pointerToTargetByte is is initialized properly here |
413 |
|
414 pointerToTargetByte += descriptorLength - 1; |
216 pointerToTargetByte += descriptorLength - 1; |
415 |
|
416 FOREVER |
217 FOREVER |
417 |
218 { |
418 { |
|
419 |
|
420 *pointerToTargetByte = *pointerToSourceByte; |
219 *pointerToTargetByte = *pointerToSourceByte; |
421 |
|
422 __ASSERT_DEBUG(pointerToTargetByte>pointerToFirstByte, |
220 __ASSERT_DEBUG(pointerToTargetByte>pointerToFirstByte, |
423 |
|
424 Panic(EPanicBadPointers2)); |
221 Panic(EPanicBadPointers2)); |
425 |
|
426 --pointerToTargetByte; |
222 --pointerToTargetByte; |
427 |
|
428 *pointerToTargetByte = KSingleShift2; |
223 *pointerToTargetByte = KSingleShift2; |
429 |
|
430 __ASSERT_DEBUG(pointerToTargetByte >= pointerToFirstByte, |
224 __ASSERT_DEBUG(pointerToTargetByte >= pointerToFirstByte, |
431 |
|
432 Panic(EPanicBadPointers3)); |
225 Panic(EPanicBadPointers3)); |
433 |
|
434 if (pointerToTargetByte <= pointerToFirstByte) |
226 if (pointerToTargetByte <= pointerToFirstByte) |
435 |
|
436 { |
227 { |
437 |
|
438 break; |
228 break; |
439 |
|
440 } |
229 } |
441 |
|
442 --pointerToTargetByte; |
230 --pointerToTargetByte; |
443 |
|
444 __ASSERT_DEBUG(pointerToSourceByte > pointerToFirstByte, |
231 __ASSERT_DEBUG(pointerToSourceByte > pointerToFirstByte, |
445 |
|
446 Panic(EPanicBadPointers4)); |
232 Panic(EPanicBadPointers4)); |
447 |
|
448 --pointerToSourceByte; |
233 --pointerToSourceByte; |
449 |
234 } |
450 } |
|
451 |
|
452 __ASSERT_DEBUG(pointerToTargetByte == pointerToFirstByte, |
235 __ASSERT_DEBUG(pointerToTargetByte == pointerToFirstByte, |
453 |
|
454 Panic(EPanicBadPointers5)); |
236 Panic(EPanicBadPointers5)); |
455 |
|
456 __ASSERT_DEBUG(pointerToSourceByte == pointerToFirstByte, |
237 __ASSERT_DEBUG(pointerToSourceByte == pointerToFirstByte, |
457 |
|
458 Panic(EPanicBadPointers6)); |
238 Panic(EPanicBadPointers6)); |
459 |
239 } |
460 } |
240 } |
461 |
241 |
462 } |
242 // ----------------------------------------------------------------------------- |
463 |
|
464 |
|
465 |
|
466 // ----------------------------------------------------------------------------- |
|
467 |
|
468 // ConvertFromJisX0212ToEucJpPackedInPlace |
243 // ConvertFromJisX0212ToEucJpPackedInPlace |
469 |
|
470 // Converts from JIS code to EUC-JP |
244 // Converts from JIS code to EUC-JP |
471 |
245 // ----------------------------------------------------------------------------- |
472 // ----------------------------------------------------------------------------- |
246 // |
473 |
|
474 // |
|
475 |
|
476 LOCAL_C void ConvertFromJisX0212ToEucJpPackedInPlace( |
247 LOCAL_C void ConvertFromJisX0212ToEucJpPackedInPlace( |
477 |
|
478 TInt aStartPositionInDescriptor, TDes8& aDescriptor, |
248 TInt aStartPositionInDescriptor, TDes8& aDescriptor, |
479 |
|
480 TInt& aNumberOfCharactersThatDroppedOut) |
249 TInt& aNumberOfCharactersThatDroppedOut) |
481 |
250 { |
482 { |
|
483 |
|
484 TInt descriptorLength=aDescriptor.Length(); |
251 TInt descriptorLength=aDescriptor.Length(); |
485 |
|
486 __ASSERT_DEBUG(descriptorLength > aStartPositionInDescriptor, |
252 __ASSERT_DEBUG(descriptorLength > aStartPositionInDescriptor, |
487 |
|
488 Panic(EPanicNothingToConvert3)); |
253 Panic(EPanicNothingToConvert3)); |
489 |
|
490 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
254 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
491 |
|
492 Panic(EPanicOddNumberOfBytes3)); |
255 Panic(EPanicOddNumberOfBytes3)); |
493 |
|
494 aNumberOfCharactersThatDroppedOut = |
256 aNumberOfCharactersThatDroppedOut = |
495 |
|
496 Max(0, ((descriptorLength - aStartPositionInDescriptor) / 2) - |
257 Max(0, ((descriptorLength - aStartPositionInDescriptor) / 2) - |
497 |
|
498 ((aDescriptor.MaxLength() - aStartPositionInDescriptor) / 3)); |
258 ((aDescriptor.MaxLength() - aStartPositionInDescriptor) / 3)); |
499 |
|
500 descriptorLength -= aNumberOfCharactersThatDroppedOut * 2; |
259 descriptorLength -= aNumberOfCharactersThatDroppedOut * 2; |
501 |
|
502 __ASSERT_DEBUG(descriptorLength >= aStartPositionInDescriptor, |
260 __ASSERT_DEBUG(descriptorLength >= aStartPositionInDescriptor, |
503 |
|
504 Panic(EPanicBadCalculation2)); |
261 Panic(EPanicBadCalculation2)); |
505 |
|
506 if (descriptorLength <= aStartPositionInDescriptor) |
262 if (descriptorLength <= aStartPositionInDescriptor) |
507 |
263 { |
508 { |
|
509 |
|
510 aDescriptor.SetLength(descriptorLength); |
264 aDescriptor.SetLength(descriptorLength); |
511 |
265 } |
512 } |
|
513 |
|
514 else |
266 else |
515 |
267 { |
516 { |
|
517 |
|
518 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
268 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
519 |
|
520 Panic(EPanicOddNumberOfBytes4)); |
269 Panic(EPanicOddNumberOfBytes4)); |
521 |
|
522 // pointerToTargetByte is initialized properly when descriptorLength |
270 // pointerToTargetByte is initialized properly when descriptorLength |
523 |
|
524 // has been offset to the actual final length of aDescriptor |
271 // has been offset to the actual final length of aDescriptor |
525 |
|
526 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
272 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
527 |
|
528 const TUint8* const pointerToFirstByte = |
273 const TUint8* const pointerToFirstByte = |
529 |
|
530 pointerToTargetByte + aStartPositionInDescriptor; |
274 pointerToTargetByte + aStartPositionInDescriptor; |
531 |
|
532 const TUint8* pointerToSourceByte = |
275 const TUint8* pointerToSourceByte = |
533 |
|
534 pointerToTargetByte + (descriptorLength - 1); |
276 pointerToTargetByte + (descriptorLength - 1); |
535 |
|
536 descriptorLength = (((descriptorLength - aStartPositionInDescriptor) |
277 descriptorLength = (((descriptorLength - aStartPositionInDescriptor) |
537 |
|
538 * 3) / 2) + aStartPositionInDescriptor; |
278 * 3) / 2) + aStartPositionInDescriptor; |
539 |
|
540 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 3 ==0, |
279 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 3 ==0, |
541 |
|
542 Panic(EPanicNumberOfBytesIsNotMultipleOfThree1)); |
280 Panic(EPanicNumberOfBytesIsNotMultipleOfThree1)); |
543 |
|
544 aDescriptor.SetLength(descriptorLength); |
281 aDescriptor.SetLength(descriptorLength); |
545 |
|
546 // pointerToTargetByte is is initialized properly here |
282 // pointerToTargetByte is is initialized properly here |
547 |
|
548 pointerToTargetByte += descriptorLength - 1; |
283 pointerToTargetByte += descriptorLength - 1; |
549 |
|
550 FOREVER |
284 FOREVER |
551 |
285 { |
552 { |
|
553 |
|
554 __ASSERT_DEBUG((*pointerToSourceByte & 0x80) == 0, |
286 __ASSERT_DEBUG((*pointerToSourceByte & 0x80) == 0, |
555 |
|
556 Panic(EPanicBadHighBit2)); |
287 Panic(EPanicBadHighBit2)); |
557 |
|
558 *pointerToTargetByte = |
288 *pointerToTargetByte = |
559 |
|
560 STATIC_CAST(TUint8, *pointerToSourceByte | 0x80); |
289 STATIC_CAST(TUint8, *pointerToSourceByte | 0x80); |
561 |
|
562 __ASSERT_DEBUG(pointerToTargetByte > pointerToFirstByte, |
290 __ASSERT_DEBUG(pointerToTargetByte > pointerToFirstByte, |
563 |
|
564 Panic(EPanicBadPointers7)); |
291 Panic(EPanicBadPointers7)); |
565 |
|
566 --pointerToTargetByte; |
292 --pointerToTargetByte; |
567 |
|
568 __ASSERT_DEBUG(pointerToSourceByte > pointerToFirstByte, |
293 __ASSERT_DEBUG(pointerToSourceByte > pointerToFirstByte, |
569 |
|
570 Panic(EPanicBadPointers8)); |
294 Panic(EPanicBadPointers8)); |
571 |
|
572 --pointerToSourceByte; |
295 --pointerToSourceByte; |
573 |
|
574 __ASSERT_DEBUG((*pointerToSourceByte & 0x80) == 0, |
296 __ASSERT_DEBUG((*pointerToSourceByte & 0x80) == 0, |
575 |
|
576 Panic(EPanicBadHighBit3)); |
297 Panic(EPanicBadHighBit3)); |
577 |
|
578 *pointerToTargetByte = |
298 *pointerToTargetByte = |
579 |
|
580 STATIC_CAST(TUint8, *pointerToSourceByte | 0x80); |
299 STATIC_CAST(TUint8, *pointerToSourceByte | 0x80); |
581 |
|
582 __ASSERT_DEBUG(pointerToTargetByte > pointerToFirstByte, |
300 __ASSERT_DEBUG(pointerToTargetByte > pointerToFirstByte, |
583 |
|
584 Panic(EPanicBadPointers9)); |
301 Panic(EPanicBadPointers9)); |
585 |
|
586 --pointerToTargetByte; |
302 --pointerToTargetByte; |
587 |
|
588 *pointerToTargetByte = KSingleShift3; |
303 *pointerToTargetByte = KSingleShift3; |
589 |
|
590 __ASSERT_DEBUG(pointerToTargetByte >= pointerToFirstByte, |
304 __ASSERT_DEBUG(pointerToTargetByte >= pointerToFirstByte, |
591 |
|
592 Panic(EPanicBadPointers10)); |
305 Panic(EPanicBadPointers10)); |
593 |
|
594 if (pointerToTargetByte <= pointerToFirstByte) |
306 if (pointerToTargetByte <= pointerToFirstByte) |
595 |
|
596 { |
307 { |
597 |
|
598 break; |
308 break; |
599 |
|
600 } |
309 } |
601 |
|
602 --pointerToTargetByte; |
310 --pointerToTargetByte; |
603 |
|
604 __ASSERT_DEBUG(pointerToSourceByte > pointerToFirstByte, |
311 __ASSERT_DEBUG(pointerToSourceByte > pointerToFirstByte, |
605 |
|
606 Panic(EPanicBadPointers11)); |
312 Panic(EPanicBadPointers11)); |
607 |
|
608 --pointerToSourceByte; |
313 --pointerToSourceByte; |
609 |
314 } |
610 } |
|
611 |
|
612 __ASSERT_DEBUG(pointerToTargetByte == pointerToFirstByte, |
315 __ASSERT_DEBUG(pointerToTargetByte == pointerToFirstByte, |
613 |
|
614 Panic(EPanicBadPointers12)); |
316 Panic(EPanicBadPointers12)); |
615 |
|
616 __ASSERT_DEBUG(pointerToSourceByte == pointerToFirstByte, |
317 __ASSERT_DEBUG(pointerToSourceByte == pointerToFirstByte, |
617 |
|
618 Panic(EPanicBadPointers13)); |
318 Panic(EPanicBadPointers13)); |
619 |
319 } |
620 } |
320 } |
621 |
321 |
622 } |
322 // ----------------------------------------------------------------------------- |
623 |
|
624 |
|
625 |
|
626 // ----------------------------------------------------------------------------- |
|
627 |
|
628 // NumberOfBytesAbleToConvertToJisRoman |
323 // NumberOfBytesAbleToConvertToJisRoman |
629 |
|
630 // Counts the bytes of be able to convert to JIS |
324 // Counts the bytes of be able to convert to JIS |
631 |
325 // ----------------------------------------------------------------------------- |
632 // ----------------------------------------------------------------------------- |
326 // |
633 |
|
634 // |
|
635 |
|
636 LOCAL_C TInt NumberOfBytesAbleToConvertToJisRoman(const TDesC8& aDescriptor) |
327 LOCAL_C TInt NumberOfBytesAbleToConvertToJisRoman(const TDesC8& aDescriptor) |
637 |
328 { |
638 { |
|
639 |
|
640 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
329 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
641 |
|
642 const TUint8* const pointerToLastByte = |
330 const TUint8* const pointerToLastByte = |
643 |
|
644 pointerToPreviousByte + aDescriptor.Length(); |
331 pointerToPreviousByte + aDescriptor.Length(); |
645 |
|
646 if (pointerToPreviousByte == pointerToLastByte) |
332 if (pointerToPreviousByte == pointerToLastByte) |
647 |
333 { |
648 { |
|
649 |
|
650 return 0; |
334 return 0; |
651 |
335 } |
652 } |
|
653 |
|
654 FOREVER |
336 FOREVER |
655 |
337 { |
656 { |
338 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
657 |
|
658 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
659 |
|
660 Panic(EPanicBadPointers14)); |
339 Panic(EPanicBadPointers14)); |
661 |
|
662 const TUint currentByte = *(pointerToPreviousByte + 1); |
340 const TUint currentByte = *(pointerToPreviousByte + 1); |
663 |
|
664 if (currentByte & 0x80) |
341 if (currentByte & 0x80) |
665 |
342 { |
666 { |
343 break; |
667 |
344 } |
668 break; |
345 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
669 |
|
670 } |
|
671 |
|
672 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
673 |
|
674 Panic(EPanicBadPointers15)); |
346 Panic(EPanicBadPointers15)); |
675 |
|
676 ++pointerToPreviousByte; |
347 ++pointerToPreviousByte; |
677 |
|
678 __ASSERT_DEBUG(pointerToPreviousByte <= pointerToLastByte, |
348 __ASSERT_DEBUG(pointerToPreviousByte <= pointerToLastByte, |
679 |
|
680 Panic(EPanicBadPointers16)); |
349 Panic(EPanicBadPointers16)); |
681 |
|
682 if (pointerToPreviousByte >= pointerToLastByte) |
350 if (pointerToPreviousByte >= pointerToLastByte) |
683 |
351 { |
684 { |
352 break; |
685 |
353 } |
686 break; |
354 } |
687 |
|
688 } |
|
689 |
|
690 } |
|
691 |
|
692 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
355 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
693 |
356 } |
694 } |
357 |
695 |
358 // ----------------------------------------------------------------------------- |
696 |
|
697 |
|
698 // ----------------------------------------------------------------------------- |
|
699 |
|
700 // NumberOfBytesAbleToConvertToJisX0208 |
359 // NumberOfBytesAbleToConvertToJisX0208 |
701 |
|
702 // Counts the bytes of be able to convert to JIS |
360 // Counts the bytes of be able to convert to JIS |
703 |
361 // ----------------------------------------------------------------------------- |
704 // ----------------------------------------------------------------------------- |
362 // |
705 |
|
706 // |
|
707 |
|
708 LOCAL_C TInt NumberOfBytesAbleToConvertToJisX0208(const TDesC8& aDescriptor) |
363 LOCAL_C TInt NumberOfBytesAbleToConvertToJisX0208(const TDesC8& aDescriptor) |
709 |
364 { |
710 { |
|
711 |
|
712 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
365 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
713 |
|
714 const TUint8* const pointerToLastByte = |
366 const TUint8* const pointerToLastByte = |
715 |
|
716 pointerToPreviousByte + aDescriptor.Length(); |
367 pointerToPreviousByte + aDescriptor.Length(); |
717 |
|
718 if (pointerToPreviousByte == pointerToLastByte) |
368 if (pointerToPreviousByte == pointerToLastByte) |
719 |
369 { |
720 { |
|
721 |
|
722 return 0; |
370 return 0; |
723 |
371 } |
724 } |
|
725 |
|
726 FOREVER |
372 FOREVER |
727 |
373 { |
728 { |
374 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
729 |
|
730 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
731 |
|
732 Panic(EPanicBadPointers17)); |
375 Panic(EPanicBadPointers17)); |
733 |
|
734 TUint currentByte = *(pointerToPreviousByte + 1); |
376 TUint currentByte = *(pointerToPreviousByte + 1); |
735 |
|
736 if (currentByte < 0xa0) |
377 if (currentByte < 0xa0) |
737 |
378 { |
738 { |
379 break; |
739 |
380 } |
740 break; |
381 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
741 |
|
742 } |
|
743 |
|
744 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
745 |
|
746 Panic(EPanicBadPointers18)); |
382 Panic(EPanicBadPointers18)); |
747 |
|
748 if (pointerToLastByte - pointerToPreviousByte < 2) |
383 if (pointerToLastByte - pointerToPreviousByte < 2) |
749 |
384 { |
750 { |
385 break; |
751 |
386 } |
752 break; |
|
753 |
|
754 } |
|
755 |
|
756 ++pointerToPreviousByte; |
387 ++pointerToPreviousByte; |
757 |
|
758 currentByte = *(pointerToPreviousByte + 1); |
388 currentByte = *(pointerToPreviousByte + 1); |
759 |
|
760 if (currentByte < 0xa0) |
389 if (currentByte < 0xa0) |
761 |
390 { |
762 { |
|
763 |
|
764 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
391 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
765 |
392 } |
766 } |
393 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
767 |
|
768 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
769 |
|
770 Panic(EPanicBadPointers19)); |
394 Panic(EPanicBadPointers19)); |
771 |
|
772 ++pointerToPreviousByte; |
395 ++pointerToPreviousByte; |
773 |
|
774 __ASSERT_DEBUG(pointerToPreviousByte <= pointerToLastByte, |
396 __ASSERT_DEBUG(pointerToPreviousByte <= pointerToLastByte, |
775 |
|
776 Panic(EPanicBadPointers20)); |
397 Panic(EPanicBadPointers20)); |
777 |
|
778 if (pointerToPreviousByte >= pointerToLastByte) |
398 if (pointerToPreviousByte >= pointerToLastByte) |
779 |
399 { |
780 { |
400 break; |
781 |
401 } |
782 break; |
402 } |
783 |
|
784 } |
|
785 |
|
786 } |
|
787 |
|
788 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
403 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
789 |
404 } |
790 } |
405 |
791 |
406 // ----------------------------------------------------------------------------- |
792 |
|
793 |
|
794 // ----------------------------------------------------------------------------- |
|
795 |
|
796 // NumberOfBytesAbleToConvertToHalfWidthKatakana8 |
407 // NumberOfBytesAbleToConvertToHalfWidthKatakana8 |
797 |
|
798 // Counts the bytes of be able to convert to half width Katakana |
408 // Counts the bytes of be able to convert to half width Katakana |
799 |
409 // ----------------------------------------------------------------------------- |
800 // ----------------------------------------------------------------------------- |
410 // |
801 |
|
802 // |
|
803 |
|
804 LOCAL_C TInt NumberOfBytesAbleToConvertToHalfWidthKatakana8(const TDesC8& aDescriptor) |
411 LOCAL_C TInt NumberOfBytesAbleToConvertToHalfWidthKatakana8(const TDesC8& aDescriptor) |
805 |
412 { |
806 { |
|
807 |
|
808 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
413 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
809 |
|
810 const TUint8* const pointerToLastByte = |
414 const TUint8* const pointerToLastByte = |
811 |
|
812 pointerToPreviousByte + aDescriptor.Length(); |
415 pointerToPreviousByte + aDescriptor.Length(); |
813 |
|
814 if (pointerToPreviousByte == pointerToLastByte) |
416 if (pointerToPreviousByte == pointerToLastByte) |
815 |
417 { |
816 { |
|
817 |
|
818 return 0; |
418 return 0; |
819 |
419 } |
820 } |
|
821 |
|
822 FOREVER |
420 FOREVER |
823 |
421 { |
824 { |
422 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
825 |
|
826 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
827 |
|
828 Panic(EPanicBadPointers21)); |
423 Panic(EPanicBadPointers21)); |
829 |
|
830 TUint currentByte = *(pointerToPreviousByte + 1); |
424 TUint currentByte = *(pointerToPreviousByte + 1); |
831 |
|
832 if (currentByte != KSingleShift2) |
425 if (currentByte != KSingleShift2) |
833 |
426 { |
834 { |
427 break; |
835 |
428 } |
836 break; |
429 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
837 |
|
838 } |
|
839 |
|
840 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
841 |
|
842 Panic(EPanicBadPointers22)); |
430 Panic(EPanicBadPointers22)); |
843 |
|
844 if (pointerToLastByte - pointerToPreviousByte < 2) |
431 if (pointerToLastByte - pointerToPreviousByte < 2) |
845 |
432 { |
846 { |
433 break; |
847 |
434 } |
848 break; |
|
849 |
|
850 } |
|
851 |
|
852 ++pointerToPreviousByte; |
435 ++pointerToPreviousByte; |
853 |
|
854 currentByte = *(pointerToPreviousByte + 1); |
436 currentByte = *(pointerToPreviousByte + 1); |
855 |
|
856 if (currentByte < 0xa0) |
437 if (currentByte < 0xa0) |
857 |
438 { |
858 { |
|
859 |
|
860 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
439 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
861 |
440 } |
862 } |
441 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
863 |
|
864 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
865 |
|
866 Panic(EPanicBadPointers23)); |
442 Panic(EPanicBadPointers23)); |
867 |
|
868 ++pointerToPreviousByte; |
443 ++pointerToPreviousByte; |
869 |
|
870 __ASSERT_DEBUG(pointerToPreviousByte <= pointerToLastByte, |
444 __ASSERT_DEBUG(pointerToPreviousByte <= pointerToLastByte, |
871 |
|
872 Panic(EPanicBadPointers24)); |
445 Panic(EPanicBadPointers24)); |
873 |
|
874 if (pointerToPreviousByte >= pointerToLastByte) |
446 if (pointerToPreviousByte >= pointerToLastByte) |
875 |
447 { |
876 { |
448 break; |
877 |
449 } |
878 break; |
450 } |
879 |
|
880 } |
|
881 |
|
882 } |
|
883 |
|
884 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
451 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
885 |
452 } |
886 } |
453 |
887 |
454 // ----------------------------------------------------------------------------- |
888 |
|
889 |
|
890 // ----------------------------------------------------------------------------- |
|
891 |
|
892 // NumberOfBytesAbleToConvertToJisX0212 |
455 // NumberOfBytesAbleToConvertToJisX0212 |
893 |
|
894 // Counts the bytes of be able to convert to JIS |
456 // Counts the bytes of be able to convert to JIS |
895 |
457 // ----------------------------------------------------------------------------- |
896 // ----------------------------------------------------------------------------- |
458 // |
897 |
|
898 // |
|
899 |
|
900 LOCAL_C TInt NumberOfBytesAbleToConvertToJisX0212(const TDesC8& aDescriptor) |
459 LOCAL_C TInt NumberOfBytesAbleToConvertToJisX0212(const TDesC8& aDescriptor) |
901 |
460 { |
902 { |
|
903 |
|
904 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
461 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
905 |
|
906 const TUint8* const pointerToLastByte = |
462 const TUint8* const pointerToLastByte = |
907 |
|
908 pointerToPreviousByte + aDescriptor.Length(); |
463 pointerToPreviousByte + aDescriptor.Length(); |
909 |
|
910 if (pointerToPreviousByte == pointerToLastByte) |
464 if (pointerToPreviousByte == pointerToLastByte) |
911 |
465 { |
912 { |
|
913 |
|
914 return 0; |
466 return 0; |
915 |
467 } |
916 } |
|
917 |
|
918 FOREVER |
468 FOREVER |
919 |
469 { |
920 { |
470 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
921 |
|
922 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
923 |
|
924 Panic(EPanicBadPointers25)); |
471 Panic(EPanicBadPointers25)); |
925 |
|
926 TUint currentByte = *(pointerToPreviousByte + 1); |
472 TUint currentByte = *(pointerToPreviousByte + 1); |
927 |
|
928 if (currentByte != KSingleShift3) |
473 if (currentByte != KSingleShift3) |
929 |
474 { |
930 { |
475 break; |
931 |
476 } |
932 break; |
477 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
933 |
|
934 } |
|
935 |
|
936 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
937 |
|
938 Panic(EPanicBadPointers26)); |
478 Panic(EPanicBadPointers26)); |
939 |
|
940 if (pointerToLastByte - pointerToPreviousByte < 3) |
479 if (pointerToLastByte - pointerToPreviousByte < 3) |
941 |
480 { |
942 { |
481 break; |
943 |
482 } |
944 break; |
|
945 |
|
946 } |
|
947 |
|
948 ++pointerToPreviousByte; |
483 ++pointerToPreviousByte; |
949 |
|
950 currentByte = *(pointerToPreviousByte + 1); |
484 currentByte = *(pointerToPreviousByte + 1); |
951 |
|
952 if (currentByte < 0xa0) |
485 if (currentByte < 0xa0) |
953 |
486 { |
954 { |
|
955 |
|
956 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
487 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
957 |
488 } |
958 } |
489 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
959 |
|
960 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
961 |
|
962 Panic(EPanicBadPointers27)); |
490 Panic(EPanicBadPointers27)); |
963 |
|
964 ++pointerToPreviousByte; |
491 ++pointerToPreviousByte; |
965 |
|
966 currentByte = *(pointerToPreviousByte + 1); |
492 currentByte = *(pointerToPreviousByte + 1); |
967 |
|
968 if (currentByte < 0xa0) |
493 if (currentByte < 0xa0) |
969 |
494 { |
970 { |
|
971 |
|
972 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
495 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
973 |
496 } |
974 } |
497 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
975 |
|
976 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
977 |
|
978 Panic(EPanicBadPointers28)); |
498 Panic(EPanicBadPointers28)); |
979 |
|
980 ++pointerToPreviousByte; |
499 ++pointerToPreviousByte; |
981 |
|
982 __ASSERT_DEBUG(pointerToPreviousByte <= pointerToLastByte, |
500 __ASSERT_DEBUG(pointerToPreviousByte <= pointerToLastByte, |
983 |
|
984 Panic(EPanicBadPointers29)); |
501 Panic(EPanicBadPointers29)); |
985 |
|
986 if (pointerToPreviousByte >= pointerToLastByte) |
502 if (pointerToPreviousByte >= pointerToLastByte) |
987 |
503 { |
988 { |
504 break; |
989 |
505 } |
990 break; |
506 } |
991 |
|
992 } |
|
993 |
|
994 } |
|
995 |
|
996 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
507 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
997 |
508 } |
998 } |
509 |
999 |
510 // ----------------------------------------------------------------------------- |
1000 |
|
1001 |
|
1002 // ----------------------------------------------------------------------------- |
|
1003 |
|
1004 // DummyConvertToIntermediateBufferInPlace |
511 // DummyConvertToIntermediateBufferInPlace |
1005 |
512 // |
1006 // |
513 // ----------------------------------------------------------------------------- |
1007 |
514 // |
1008 // ----------------------------------------------------------------------------- |
|
1009 |
|
1010 // |
|
1011 |
|
1012 LOCAL_C void DummyConvertToIntermediateBufferInPlace(TDes8&) |
515 LOCAL_C void DummyConvertToIntermediateBufferInPlace(TDes8&) |
1013 |
516 { |
1014 { |
517 } |
1015 |
518 |
1016 } |
519 // ----------------------------------------------------------------------------- |
1017 |
|
1018 |
|
1019 |
|
1020 // ----------------------------------------------------------------------------- |
|
1021 |
|
1022 // ConvertToJisX0208FromEucJpPackedInPlace |
520 // ConvertToJisX0208FromEucJpPackedInPlace |
1023 |
|
1024 // Converts from EUC-JP to JIS code |
521 // Converts from EUC-JP to JIS code |
1025 |
522 // ----------------------------------------------------------------------------- |
1026 // ----------------------------------------------------------------------------- |
523 // |
1027 |
|
1028 // |
|
1029 |
|
1030 LOCAL_C void ConvertToJisX0208FromEucJpPackedInPlace(TDes8& aDescriptor) |
524 LOCAL_C void ConvertToJisX0208FromEucJpPackedInPlace(TDes8& aDescriptor) |
1031 |
525 { |
1032 { |
|
1033 |
|
1034 const TInt descriptorLength = aDescriptor.Length(); |
526 const TInt descriptorLength = aDescriptor.Length(); |
1035 |
|
1036 __ASSERT_DEBUG(descriptorLength > 0, Panic(EPanicNothingToConvert4)); |
527 __ASSERT_DEBUG(descriptorLength > 0, Panic(EPanicNothingToConvert4)); |
1037 |
|
1038 __ASSERT_DEBUG(descriptorLength % 2 == 0, Panic(EPanicOddNumberOfBytes5)); |
528 __ASSERT_DEBUG(descriptorLength % 2 == 0, Panic(EPanicOddNumberOfBytes5)); |
1039 |
|
1040 TUint8* pointerToCurrentByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
529 TUint8* pointerToCurrentByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
1041 |
|
1042 const TUint8* const pointerToLastByte = |
530 const TUint8* const pointerToLastByte = |
1043 |
|
1044 pointerToCurrentByte + (descriptorLength - 1); |
531 pointerToCurrentByte + (descriptorLength - 1); |
1045 |
|
1046 FOREVER |
532 FOREVER |
1047 |
533 { |
1048 { |
|
1049 |
|
1050 const TUint currentByte = *pointerToCurrentByte; |
534 const TUint currentByte = *pointerToCurrentByte; |
1051 |
|
1052 __ASSERT_DEBUG(currentByte & 0x80, Panic(EPanicBadHighBit4)); |
535 __ASSERT_DEBUG(currentByte & 0x80, Panic(EPanicBadHighBit4)); |
1053 |
|
1054 *pointerToCurrentByte = STATIC_CAST(TUint8, currentByte & ~0x80); |
536 *pointerToCurrentByte = STATIC_CAST(TUint8, currentByte & ~0x80); |
1055 |
|
1056 __ASSERT_DEBUG(pointerToCurrentByte <= pointerToLastByte, |
537 __ASSERT_DEBUG(pointerToCurrentByte <= pointerToLastByte, |
1057 |
|
1058 Panic(EPanicBadPointers30)); |
538 Panic(EPanicBadPointers30)); |
1059 |
|
1060 if (pointerToCurrentByte >= pointerToLastByte) |
539 if (pointerToCurrentByte >= pointerToLastByte) |
1061 |
540 { |
1062 { |
541 break; |
1063 |
542 } |
1064 break; |
|
1065 |
|
1066 } |
|
1067 |
|
1068 ++pointerToCurrentByte; |
543 ++pointerToCurrentByte; |
1069 |
544 } |
1070 } |
545 } |
1071 |
546 |
1072 } |
547 // ----------------------------------------------------------------------------- |
1073 |
|
1074 |
|
1075 |
|
1076 // ----------------------------------------------------------------------------- |
|
1077 |
|
1078 // ConvertToHalfWidthKatakana8FromEucJpPackedInPlace |
548 // ConvertToHalfWidthKatakana8FromEucJpPackedInPlace |
1079 |
|
1080 // Converts from EUC-JP to half width Katakana |
549 // Converts from EUC-JP to half width Katakana |
1081 |
550 // ----------------------------------------------------------------------------- |
1082 // ----------------------------------------------------------------------------- |
551 // |
1083 |
|
1084 // |
|
1085 |
|
1086 LOCAL_C void ConvertToHalfWidthKatakana8FromEucJpPackedInPlace( |
552 LOCAL_C void ConvertToHalfWidthKatakana8FromEucJpPackedInPlace( |
1087 |
|
1088 TDes8& aDescriptor) |
553 TDes8& aDescriptor) |
1089 |
554 { |
1090 { |
|
1091 |
|
1092 const TInt descriptorLength = aDescriptor.Length(); |
555 const TInt descriptorLength = aDescriptor.Length(); |
1093 |
|
1094 __ASSERT_DEBUG(descriptorLength > 0, Panic(EPanicNothingToConvert5)); |
556 __ASSERT_DEBUG(descriptorLength > 0, Panic(EPanicNothingToConvert5)); |
1095 |
|
1096 __ASSERT_DEBUG(descriptorLength % 2 == 0, Panic(EPanicOddNumberOfBytes6)); |
557 __ASSERT_DEBUG(descriptorLength % 2 == 0, Panic(EPanicOddNumberOfBytes6)); |
1097 |
|
1098 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
558 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
1099 |
|
1100 const TUint8* pointerToSourceByte = pointerToTargetByte; |
559 const TUint8* pointerToSourceByte = pointerToTargetByte; |
1101 |
|
1102 const TUint8* const pointerToLastByte = pointerToSourceByte + |
560 const TUint8* const pointerToLastByte = pointerToSourceByte + |
1103 |
|
1104 (descriptorLength - 1); |
561 (descriptorLength - 1); |
1105 |
|
1106 FOREVER |
562 FOREVER |
1107 |
563 { |
1108 { |
|
1109 |
|
1110 __ASSERT_DEBUG(*pointerToSourceByte == KSingleShift2, |
564 __ASSERT_DEBUG(*pointerToSourceByte == KSingleShift2, |
1111 |
|
1112 Panic(EPanicSingleShift2Expected)); |
565 Panic(EPanicSingleShift2Expected)); |
1113 |
|
1114 __ASSERT_DEBUG(pointerToSourceByte < pointerToLastByte, |
566 __ASSERT_DEBUG(pointerToSourceByte < pointerToLastByte, |
1115 |
|
1116 Panic(EPanicBadPointers31)); |
567 Panic(EPanicBadPointers31)); |
1117 |
|
1118 ++pointerToSourceByte; |
568 ++pointerToSourceByte; |
1119 |
|
1120 const TUint sourceByte = *pointerToSourceByte; |
569 const TUint sourceByte = *pointerToSourceByte; |
1121 |
|
1122 __ASSERT_DEBUG(sourceByte & 0x80, Panic(EPanicBadHighBit5)); |
570 __ASSERT_DEBUG(sourceByte & 0x80, Panic(EPanicBadHighBit5)); |
1123 |
|
1124 *pointerToTargetByte = STATIC_CAST(TUint8, sourceByte); |
571 *pointerToTargetByte = STATIC_CAST(TUint8, sourceByte); |
1125 |
|
1126 __ASSERT_DEBUG(pointerToSourceByte <= pointerToLastByte, |
572 __ASSERT_DEBUG(pointerToSourceByte <= pointerToLastByte, |
1127 |
|
1128 Panic(EPanicBadPointers32)); |
573 Panic(EPanicBadPointers32)); |
1129 |
|
1130 if (pointerToSourceByte >= pointerToLastByte) |
574 if (pointerToSourceByte >= pointerToLastByte) |
1131 |
575 { |
1132 { |
576 break; |
1133 |
577 } |
1134 break; |
|
1135 |
|
1136 } |
|
1137 |
|
1138 ++pointerToSourceByte; |
578 ++pointerToSourceByte; |
1139 |
|
1140 ++pointerToTargetByte; |
579 ++pointerToTargetByte; |
1141 |
580 } |
1142 } |
|
1143 |
|
1144 aDescriptor.SetLength(descriptorLength / 2); |
581 aDescriptor.SetLength(descriptorLength / 2); |
1145 |
582 } |
1146 } |
583 |
1147 |
584 // ----------------------------------------------------------------------------- |
1148 |
|
1149 |
|
1150 // ----------------------------------------------------------------------------- |
|
1151 |
|
1152 // ConvertToJisX0212FromEucJpPackedInPlace |
585 // ConvertToJisX0212FromEucJpPackedInPlace |
1153 |
|
1154 // Converts from EUC-JP to JIS |
586 // Converts from EUC-JP to JIS |
1155 |
587 // ----------------------------------------------------------------------------- |
1156 // ----------------------------------------------------------------------------- |
588 // |
1157 |
|
1158 // |
|
1159 |
|
1160 LOCAL_C void ConvertToJisX0212FromEucJpPackedInPlace(TDes8& aDescriptor) |
589 LOCAL_C void ConvertToJisX0212FromEucJpPackedInPlace(TDes8& aDescriptor) |
1161 |
590 { |
1162 { |
|
1163 |
|
1164 const TInt descriptorLength = aDescriptor.Length(); |
591 const TInt descriptorLength = aDescriptor.Length(); |
1165 |
|
1166 __ASSERT_DEBUG(descriptorLength > 0, Panic(EPanicNothingToConvert6)); |
592 __ASSERT_DEBUG(descriptorLength > 0, Panic(EPanicNothingToConvert6)); |
1167 |
|
1168 __ASSERT_DEBUG(descriptorLength % 3 == 0, |
593 __ASSERT_DEBUG(descriptorLength % 3 == 0, |
1169 |
|
1170 Panic(EPanicNumberOfBytesIsNotMultipleOfThree2)); |
594 Panic(EPanicNumberOfBytesIsNotMultipleOfThree2)); |
1171 |
|
1172 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
595 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
1173 |
|
1174 const TUint8* pointerToSourceByte = pointerToTargetByte; |
596 const TUint8* pointerToSourceByte = pointerToTargetByte; |
1175 |
|
1176 const TUint8* const pointerToLastByte = |
597 const TUint8* const pointerToLastByte = |
1177 |
|
1178 pointerToSourceByte + (descriptorLength - 1); |
598 pointerToSourceByte + (descriptorLength - 1); |
1179 |
|
1180 FOREVER |
599 FOREVER |
1181 |
600 { |
1182 { |
|
1183 |
|
1184 __ASSERT_DEBUG(*pointerToSourceByte == KSingleShift3, |
601 __ASSERT_DEBUG(*pointerToSourceByte == KSingleShift3, |
1185 |
|
1186 Panic(EPanicSingleShift3Expected)); |
602 Panic(EPanicSingleShift3Expected)); |
1187 |
|
1188 __ASSERT_DEBUG(pointerToSourceByte < pointerToLastByte, |
603 __ASSERT_DEBUG(pointerToSourceByte < pointerToLastByte, |
1189 |
|
1190 Panic(EPanicBadPointers33)); |
604 Panic(EPanicBadPointers33)); |
1191 |
|
1192 ++pointerToSourceByte; |
605 ++pointerToSourceByte; |
1193 |
|
1194 TUint sourceByte = *pointerToSourceByte; |
606 TUint sourceByte = *pointerToSourceByte; |
1195 |
|
1196 __ASSERT_DEBUG(sourceByte & 0x80, Panic(EPanicBadHighBit6)); |
607 __ASSERT_DEBUG(sourceByte & 0x80, Panic(EPanicBadHighBit6)); |
1197 |
|
1198 *pointerToTargetByte = STATIC_CAST(TUint8, sourceByte & ~0x80); |
608 *pointerToTargetByte = STATIC_CAST(TUint8, sourceByte & ~0x80); |
1199 |
|
1200 __ASSERT_DEBUG(pointerToSourceByte<pointerToLastByte, |
609 __ASSERT_DEBUG(pointerToSourceByte<pointerToLastByte, |
1201 |
|
1202 Panic(EPanicBadPointers34)); |
610 Panic(EPanicBadPointers34)); |
1203 |
|
1204 ++pointerToSourceByte; |
611 ++pointerToSourceByte; |
1205 |
|
1206 sourceByte = *pointerToSourceByte; |
612 sourceByte = *pointerToSourceByte; |
1207 |
|
1208 __ASSERT_DEBUG(sourceByte&0x80, Panic(EPanicBadHighBit7)); |
613 __ASSERT_DEBUG(sourceByte&0x80, Panic(EPanicBadHighBit7)); |
1209 |
|
1210 __ASSERT_DEBUG(pointerToTargetByte < pointerToLastByte, |
614 __ASSERT_DEBUG(pointerToTargetByte < pointerToLastByte, |
1211 |
|
1212 Panic(EPanicBadPointers35)); |
615 Panic(EPanicBadPointers35)); |
1213 |
|
1214 ++pointerToTargetByte; |
616 ++pointerToTargetByte; |
1215 |
|
1216 *pointerToTargetByte = STATIC_CAST(TUint8, sourceByte & ~0x80); |
617 *pointerToTargetByte = STATIC_CAST(TUint8, sourceByte & ~0x80); |
1217 |
|
1218 __ASSERT_DEBUG(pointerToSourceByte <= pointerToLastByte, |
618 __ASSERT_DEBUG(pointerToSourceByte <= pointerToLastByte, |
1219 |
|
1220 Panic(EPanicBadPointers36)); |
619 Panic(EPanicBadPointers36)); |
1221 |
|
1222 if (pointerToSourceByte >= pointerToLastByte) |
620 if (pointerToSourceByte >= pointerToLastByte) |
1223 |
621 { |
1224 { |
622 break; |
1225 |
623 } |
1226 break; |
|
1227 |
|
1228 } |
|
1229 |
|
1230 ++pointerToSourceByte; |
624 ++pointerToSourceByte; |
1231 |
|
1232 ++pointerToTargetByte; |
625 ++pointerToTargetByte; |
1233 |
626 } |
1234 } |
|
1235 |
|
1236 aDescriptor.SetLength((descriptorLength / 3) * 2); |
627 aDescriptor.SetLength((descriptorLength / 3) * 2); |
1237 |
628 } |
1238 } |
629 |
1239 |
630 // ----------------------------------------------------------------------------- |
1240 |
|
1241 |
|
1242 // ----------------------------------------------------------------------------- |
|
1243 |
|
1244 // NumberOfBytesAbleToConvertToPictograph |
631 // NumberOfBytesAbleToConvertToPictograph |
1245 |
632 // |
1246 // |
633 // ----------------------------------------------------------------------------- |
1247 |
634 // |
1248 // ----------------------------------------------------------------------------- |
|
1249 |
|
1250 // |
|
1251 |
|
1252 LOCAL_C TInt NumberOfBytesAbleToConvertToPictograph1(const TDesC8& aDescriptor) |
635 LOCAL_C TInt NumberOfBytesAbleToConvertToPictograph1(const TDesC8& aDescriptor) |
1253 |
636 { |
1254 { |
|
1255 |
|
1256 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
637 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
1257 |
|
1258 const TUint8* const pointerToLastByte = |
638 const TUint8* const pointerToLastByte = |
1259 |
|
1260 pointerToPreviousByte + aDescriptor.Length(); |
639 pointerToPreviousByte + aDescriptor.Length(); |
1261 |
|
1262 if (pointerToPreviousByte == pointerToLastByte) |
640 if (pointerToPreviousByte == pointerToLastByte) |
1263 |
641 { |
1264 { |
|
1265 |
|
1266 return 0; |
642 return 0; |
1267 |
643 } |
1268 } |
|
1269 |
|
1270 for (;pointerToPreviousByte < pointerToLastByte;) |
644 for (;pointerToPreviousByte < pointerToLastByte;) |
1271 |
645 { |
1272 { |
646 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
1273 |
|
1274 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
1275 |
|
1276 Panic(EPanicBadPointers14)); |
647 Panic(EPanicBadPointers14)); |
1277 |
|
1278 TUint currentByte = *(pointerToPreviousByte + 1); |
648 TUint currentByte = *(pointerToPreviousByte + 1); |
1279 |
|
1280 const TUint nextByte = *(pointerToPreviousByte + 2); |
649 const TUint nextByte = *(pointerToPreviousByte + 2); |
1281 |
|
1282 if (((currentByte < KFirstByteRangeFirstBlockStart) || |
650 if (((currentByte < KFirstByteRangeFirstBlockStart) || |
1283 |
|
1284 (currentByte > KFirstByteRangeFirstBlockEnd)) || |
651 (currentByte > KFirstByteRangeFirstBlockEnd)) || |
1285 |
|
1286 ((nextByte < KSecondByteRangeSecondBlockStart) || |
652 ((nextByte < KSecondByteRangeSecondBlockStart) || |
1287 |
|
1288 (nextByte > KSecondByteRangeSecondBlockEnd))) |
653 (nextByte > KSecondByteRangeSecondBlockEnd))) |
1289 |
654 { |
1290 { |
655 break; |
1291 |
656 } |
1292 break; |
657 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
1293 |
|
1294 } |
|
1295 |
|
1296 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
1297 |
|
1298 Panic(EPanicBadPointers15)); |
658 Panic(EPanicBadPointers15)); |
1299 |
|
1300 pointerToPreviousByte += 2; |
659 pointerToPreviousByte += 2; |
1301 |
660 } |
1302 } |
|
1303 |
|
1304 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
661 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
1305 |
662 } |
1306 } |
663 |
1307 |
664 // ----------------------------------------------------------------------------- |
1308 |
|
1309 |
|
1310 // ----------------------------------------------------------------------------- |
|
1311 |
|
1312 // NumberOfBytesAbleToConvertToPictograph |
665 // NumberOfBytesAbleToConvertToPictograph |
1313 |
666 // |
1314 // |
667 // ----------------------------------------------------------------------------- |
1315 |
668 // |
1316 // ----------------------------------------------------------------------------- |
|
1317 |
|
1318 // |
|
1319 |
|
1320 LOCAL_C TInt NumberOfBytesAbleToConvertToPictograph2(const TDesC8& aDescriptor) |
669 LOCAL_C TInt NumberOfBytesAbleToConvertToPictograph2(const TDesC8& aDescriptor) |
1321 |
670 { |
1322 { |
|
1323 |
|
1324 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
671 const TUint8* pointerToPreviousByte = aDescriptor.Ptr() - 1; |
1325 |
|
1326 const TUint8* const pointerToLastByte = |
672 const TUint8* const pointerToLastByte = |
1327 |
|
1328 pointerToPreviousByte + aDescriptor.Length(); |
673 pointerToPreviousByte + aDescriptor.Length(); |
1329 |
|
1330 if (pointerToPreviousByte == pointerToLastByte) |
674 if (pointerToPreviousByte == pointerToLastByte) |
1331 |
675 { |
1332 { |
|
1333 |
|
1334 return 0; |
676 return 0; |
1335 |
677 } |
1336 } |
|
1337 |
|
1338 for (;pointerToPreviousByte < pointerToLastByte;) |
678 for (;pointerToPreviousByte < pointerToLastByte;) |
1339 |
679 { |
1340 { |
680 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
1341 |
|
1342 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
1343 |
|
1344 Panic(EPanicBadPointers14)); |
681 Panic(EPanicBadPointers14)); |
1345 |
|
1346 TUint currentByte = *(pointerToPreviousByte + 1); |
682 TUint currentByte = *(pointerToPreviousByte + 1); |
1347 |
|
1348 if (currentByte == KSingleShift3) |
683 if (currentByte == KSingleShift3) |
1349 |
684 { |
1350 { |
|
1351 |
|
1352 pointerToPreviousByte++; |
685 pointerToPreviousByte++; |
1353 |
|
1354 currentByte = *(pointerToPreviousByte + 1); |
686 currentByte = *(pointerToPreviousByte + 1); |
1355 |
687 } |
1356 } |
|
1357 |
|
1358 else |
688 else |
1359 |
689 { |
1360 { |
690 break; |
1361 |
691 } |
1362 break; |
|
1363 |
|
1364 } |
|
1365 |
|
1366 if (currentByte < 0xa0) |
692 if (currentByte < 0xa0) |
1367 |
693 { |
1368 { |
|
1369 |
|
1370 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
694 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
1371 |
695 } |
1372 } |
|
1373 |
|
1374 const TUint nextByte = *(pointerToPreviousByte + 2); |
696 const TUint nextByte = *(pointerToPreviousByte + 2); |
1375 |
|
1376 if (nextByte < 0xa0) |
697 if (nextByte < 0xa0) |
1377 |
698 { |
1378 { |
|
1379 |
|
1380 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
699 return CCnvCharacterSetConverter::EErrorIllFormedInput; |
1381 |
700 } |
1382 } |
|
1383 |
|
1384 if (((currentByte < KFirstByteRangeFirstBlockStart) || |
701 if (((currentByte < KFirstByteRangeFirstBlockStart) || |
1385 |
|
1386 (currentByte > KFirstByteRangeFirstBlockEnd)) || |
702 (currentByte > KFirstByteRangeFirstBlockEnd)) || |
1387 |
|
1388 ((nextByte < KSecondByteRangeSecondBlockStart) || |
703 ((nextByte < KSecondByteRangeSecondBlockStart) || |
1389 |
|
1390 (nextByte > KSecondByteRangeSecondBlockEnd))) |
704 (nextByte > KSecondByteRangeSecondBlockEnd))) |
1391 |
705 { |
1392 { |
|
1393 |
|
1394 // return the previous byte to the beginning of loop. |
706 // return the previous byte to the beginning of loop. |
1395 |
|
1396 pointerToPreviousByte--; |
707 pointerToPreviousByte--; |
1397 |
708 break; |
1398 break; |
709 } |
1399 |
710 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
1400 } |
|
1401 |
|
1402 __ASSERT_DEBUG(pointerToPreviousByte < pointerToLastByte, |
|
1403 |
|
1404 Panic(EPanicBadPointers15)); |
711 Panic(EPanicBadPointers15)); |
1405 |
|
1406 pointerToPreviousByte += 2; |
712 pointerToPreviousByte += 2; |
1407 |
713 } |
1408 } |
|
1409 |
|
1410 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
714 return (pointerToPreviousByte + 1) - aDescriptor.Ptr(); |
1411 |
715 } |
1412 } |
716 |
1413 |
717 // ----------------------------------------------------------------------------- |
1414 |
|
1415 |
|
1416 // ----------------------------------------------------------------------------- |
|
1417 |
|
1418 // ConvertFromPictogaphToEucJpDirectmapInPlace |
718 // ConvertFromPictogaphToEucJpDirectmapInPlace |
1419 |
|
1420 // Converts from EucJp packed Pictograph to Unicode |
719 // Converts from EucJp packed Pictograph to Unicode |
1421 |
720 // ----------------------------------------------------------------------------- |
1422 // ----------------------------------------------------------------------------- |
721 // |
1423 |
|
1424 // |
|
1425 |
|
1426 LOCAL_C void ConvertFromPictogaphToEucJpDirectmapInPlace( |
722 LOCAL_C void ConvertFromPictogaphToEucJpDirectmapInPlace( |
1427 |
|
1428 TInt aStartPositionInDescriptor, TDes8& aDescriptor, |
723 TInt aStartPositionInDescriptor, TDes8& aDescriptor, |
1429 |
|
1430 TInt& aNumberOfCharactersThatDroppedOut) |
724 TInt& aNumberOfCharactersThatDroppedOut) |
1431 |
725 { |
1432 { |
|
1433 |
|
1434 TInt descriptorLength=aDescriptor.Length(); |
726 TInt descriptorLength=aDescriptor.Length(); |
1435 |
|
1436 __ASSERT_DEBUG(descriptorLength > aStartPositionInDescriptor, |
727 __ASSERT_DEBUG(descriptorLength > aStartPositionInDescriptor, |
1437 |
|
1438 Panic(EPanicNothingToConvert3)); |
728 Panic(EPanicNothingToConvert3)); |
1439 |
|
1440 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
729 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
1441 |
|
1442 Panic(EPanicOddNumberOfBytes3)); |
730 Panic(EPanicOddNumberOfBytes3)); |
1443 |
|
1444 TInt bytesPerCharacter = 2; |
731 TInt bytesPerCharacter = 2; |
1445 |
|
1446 if (aDescriptor[0] >= KEUCJPSecondBlockStart) |
732 if (aDescriptor[0] >= KEUCJPSecondBlockStart) |
1447 |
733 { |
1448 { |
|
1449 |
|
1450 bytesPerCharacter = 3; |
734 bytesPerCharacter = 3; |
1451 |
735 } |
1452 } |
|
1453 |
|
1454 |
|
1455 |
736 |
1456 aNumberOfCharactersThatDroppedOut = |
737 aNumberOfCharactersThatDroppedOut = |
1457 |
|
1458 Max(0, ((descriptorLength - aStartPositionInDescriptor) / 2) - |
738 Max(0, ((descriptorLength - aStartPositionInDescriptor) / 2) - |
1459 |
|
1460 ((aDescriptor.MaxLength() - aStartPositionInDescriptor) / |
739 ((aDescriptor.MaxLength() - aStartPositionInDescriptor) / |
1461 |
|
1462 bytesPerCharacter)); |
740 bytesPerCharacter)); |
1463 |
|
1464 descriptorLength -= aNumberOfCharactersThatDroppedOut * 2; |
741 descriptorLength -= aNumberOfCharactersThatDroppedOut * 2; |
1465 |
|
1466 __ASSERT_DEBUG(descriptorLength >= aStartPositionInDescriptor, |
742 __ASSERT_DEBUG(descriptorLength >= aStartPositionInDescriptor, |
1467 |
|
1468 Panic(EPanicBadCalculation2)); |
743 Panic(EPanicBadCalculation2)); |
1469 |
|
1470 if (descriptorLength <= aStartPositionInDescriptor) |
744 if (descriptorLength <= aStartPositionInDescriptor) |
1471 |
745 { |
1472 { |
|
1473 |
|
1474 aDescriptor.SetLength(descriptorLength); |
746 aDescriptor.SetLength(descriptorLength); |
1475 |
747 } |
1476 } |
|
1477 |
|
1478 else |
748 else |
1479 |
749 { |
1480 { |
|
1481 |
|
1482 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
750 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % 2 == 0, |
1483 |
|
1484 Panic(EPanicOddNumberOfBytes4)); |
751 Panic(EPanicOddNumberOfBytes4)); |
1485 |
|
1486 // pointerToTargetByte is initialized properly when descriptorLength |
752 // pointerToTargetByte is initialized properly when descriptorLength |
1487 |
|
1488 // has been offset to the actual final length of aDescriptor |
753 // has been offset to the actual final length of aDescriptor |
1489 |
|
1490 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
754 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
1491 |
|
1492 const TUint8* const pointerToFirstByte = |
755 const TUint8* const pointerToFirstByte = |
1493 |
|
1494 pointerToTargetByte + aStartPositionInDescriptor; |
756 pointerToTargetByte + aStartPositionInDescriptor; |
1495 |
|
1496 const TUint8* pointerToSourceByte = |
757 const TUint8* pointerToSourceByte = |
1497 |
|
1498 pointerToTargetByte + (descriptorLength - 1); |
758 pointerToTargetByte + (descriptorLength - 1); |
1499 |
|
1500 descriptorLength = (((descriptorLength - aStartPositionInDescriptor) |
759 descriptorLength = (((descriptorLength - aStartPositionInDescriptor) |
1501 |
|
1502 * bytesPerCharacter) / 2) + aStartPositionInDescriptor; |
760 * bytesPerCharacter) / 2) + aStartPositionInDescriptor; |
1503 |
|
1504 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % |
761 __ASSERT_DEBUG((descriptorLength - aStartPositionInDescriptor) % |
1505 |
|
1506 bytesPerCharacter == 0, Panic(EPanicNumberOfBytesIsNotMultipleOfThree1)); |
762 bytesPerCharacter == 0, Panic(EPanicNumberOfBytesIsNotMultipleOfThree1)); |
1507 |
|
1508 aDescriptor.SetLength(descriptorLength); |
763 aDescriptor.SetLength(descriptorLength); |
1509 |
|
1510 // pointerToTargetByte is is initialized properly here |
764 // pointerToTargetByte is is initialized properly here |
1511 |
|
1512 pointerToTargetByte += descriptorLength - 1; |
765 pointerToTargetByte += descriptorLength - 1; |
1513 |
|
1514 for (;pointerToTargetByte > pointerToFirstByte; ) |
766 for (;pointerToTargetByte > pointerToFirstByte; ) |
1515 |
767 { |
1516 { |
|
1517 |
|
1518 TInt secondByte = *pointerToSourceByte; |
768 TInt secondByte = *pointerToSourceByte; |
1519 |
|
1520 TInt firstByte = *(pointerToSourceByte - 1); |
769 TInt firstByte = *(pointerToSourceByte - 1); |
1521 |
770 |
1522 |
|
1523 |
|
1524 if (bytesPerCharacter == 3) |
771 if (bytesPerCharacter == 3) |
1525 |
|
1526 { |
772 { |
1527 |
|
1528 firstByte = (firstByte - KEUCJPSecondBlockStart) * 2 + |
773 firstByte = (firstByte - KEUCJPSecondBlockStart) * 2 + |
1529 |
|
1530 KFirstByteRangeFirstBlockStart; |
774 KFirstByteRangeFirstBlockStart; |
1531 |
|
1532 } |
775 } |
1533 |
|
1534 else |
776 else |
1535 |
|
1536 { |
777 { |
1537 |
|
1538 firstByte = (firstByte - KPictographStartFirstByte) * 2 + |
778 firstByte = (firstByte - KPictographStartFirstByte) * 2 + |
1539 |
|
1540 KFirstByteRangeFirstBlockStart; |
779 KFirstByteRangeFirstBlockStart; |
1541 |
|
1542 } |
780 } |
1543 |
|
1544 if (static_cast<TInt>(KEUCJPBlockSize + KPictographStartSecondByte + 1) |
781 if (static_cast<TInt>(KEUCJPBlockSize + KPictographStartSecondByte + 1) |
1545 |
|
1546 < secondByte) |
782 < secondByte) |
1547 |
|
1548 { |
783 { |
1549 |
|
1550 if (secondByte > KShiftJisTrailByteIllegal) |
784 if (secondByte > KShiftJisTrailByteIllegal) |
1551 |
|
1552 secondByte -= 1; |
785 secondByte -= 1; |
1553 |
|
1554 secondByte = secondByte -(KPictographStartSecondByte + |
786 secondByte = secondByte -(KPictographStartSecondByte + |
1555 |
|
1556 KEUCJPBlockSize + 1) + KSecondByteRangeSecondBlockStart; |
787 KEUCJPBlockSize + 1) + KSecondByteRangeSecondBlockStart; |
1557 |
|
1558 firstByte++; |
788 firstByte++; |
1559 |
|
1560 } |
789 } |
1561 |
|
1562 else |
790 else |
1563 |
|
1564 { |
791 { |
1565 |
|
1566 if (secondByte > KShiftJisTrailByteIllegal) |
792 if (secondByte > KShiftJisTrailByteIllegal) |
1567 |
|
1568 secondByte -= 1; |
793 secondByte -= 1; |
1569 |
|
1570 secondByte += KSecondByteRangeSecondBlockStart - KPictographStartSecondByte; |
794 secondByte += KSecondByteRangeSecondBlockStart - KPictographStartSecondByte; |
1571 |
|
1572 } |
795 } |
1573 |
|
1574 *pointerToTargetByte = static_cast<TUint8>(secondByte); |
796 *pointerToTargetByte = static_cast<TUint8>(secondByte); |
1575 |
|
1576 --pointerToTargetByte; |
797 --pointerToTargetByte; |
1577 |
|
1578 *pointerToTargetByte = static_cast<TUint8>(firstByte); |
798 *pointerToTargetByte = static_cast<TUint8>(firstByte); |
1579 |
|
1580 if (bytesPerCharacter == 3) |
799 if (bytesPerCharacter == 3) |
1581 |
|
1582 { |
800 { |
1583 |
|
1584 --pointerToTargetByte; |
801 --pointerToTargetByte; |
1585 |
|
1586 *pointerToTargetByte = KSingleShift3; |
802 *pointerToTargetByte = KSingleShift3; |
1587 |
|
1588 } |
803 } |
1589 |
|
1590 __ASSERT_DEBUG(pointerToTargetByte >= pointerToFirstByte, |
804 __ASSERT_DEBUG(pointerToTargetByte >= pointerToFirstByte, |
1591 |
|
1592 Panic(EPanicBadPointers10)); |
805 Panic(EPanicBadPointers10)); |
1593 |
|
1594 --pointerToTargetByte; |
806 --pointerToTargetByte; |
1595 |
|
1596 pointerToSourceByte -= 2; |
807 pointerToSourceByte -= 2; |
1597 |
808 } |
1598 } |
809 } |
1599 |
810 } |
1600 } |
811 |
1601 |
812 // ----------------------------------------------------------------------------- |
1602 } |
|
1603 |
|
1604 |
|
1605 |
|
1606 // ----------------------------------------------------------------------------- |
|
1607 |
|
1608 // ConvertToPictographFromEucJpPackedInPlace1 |
813 // ConvertToPictographFromEucJpPackedInPlace1 |
1609 |
|
1610 // Converts from EucJp packed Pictograph to Unicode |
814 // Converts from EucJp packed Pictograph to Unicode |
1611 |
815 // ----------------------------------------------------------------------------- |
1612 // ----------------------------------------------------------------------------- |
816 // |
1613 |
|
1614 // |
|
1615 |
|
1616 LOCAL_C void ConvertToPictographFromEucJpPackedInPlace(TDes8& aDescriptor) |
817 LOCAL_C void ConvertToPictographFromEucJpPackedInPlace(TDes8& aDescriptor) |
1617 |
818 { |
1618 { |
|
1619 |
|
1620 const TInt descriptorLength = aDescriptor.Length(); |
819 const TInt descriptorLength = aDescriptor.Length(); |
1621 |
|
1622 __ASSERT_DEBUG(descriptorLength > 0, Panic(EPanicNothingToConvert6)); |
820 __ASSERT_DEBUG(descriptorLength > 0, Panic(EPanicNothingToConvert6)); |
1623 |
|
1624 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
821 TUint8* pointerToTargetByte = CONST_CAST(TUint8*, aDescriptor.Ptr()); |
1625 |
|
1626 const TUint8* pointerToSourceByte = pointerToTargetByte; |
822 const TUint8* pointerToSourceByte = pointerToTargetByte; |
1627 |
|
1628 const TUint8* const pointerToLastByte = |
823 const TUint8* const pointerToLastByte = |
1629 |
|
1630 pointerToSourceByte + (descriptorLength - 1); |
824 pointerToSourceByte + (descriptorLength - 1); |
1631 |
|
1632 TInt bytesPerCharacter = 2; |
825 TInt bytesPerCharacter = 2; |
1633 |
|
1634 TInt sjisStartbyte = KPictographStartFirstByte; |
826 TInt sjisStartbyte = KPictographStartFirstByte; |
1635 |
|
1636 if (*pointerToSourceByte == KSingleShift3) |
827 if (*pointerToSourceByte == KSingleShift3) |
1637 |
828 { |
1638 { |
|
1639 |
|
1640 ++pointerToSourceByte; |
829 ++pointerToSourceByte; |
1641 |
|
1642 bytesPerCharacter = 3; |
830 bytesPerCharacter = 3; |
1643 |
|
1644 sjisStartbyte = KEUCJPSecondBlockStart; |
831 sjisStartbyte = KEUCJPSecondBlockStart; |
1645 |
832 } |
1646 } |
|
1647 |
|
1648 for (;pointerToSourceByte < pointerToLastByte; ) |
833 for (;pointerToSourceByte < pointerToLastByte; ) |
1649 |
834 { |
1650 { |
|
1651 |
|
1652 __ASSERT_DEBUG(pointerToSourceByte < pointerToLastByte, |
835 __ASSERT_DEBUG(pointerToSourceByte < pointerToLastByte, |
1653 |
|
1654 Panic(EPanicBadPointers33)); |
836 Panic(EPanicBadPointers33)); |
1655 |
|
1656 TUint firstByte = (*pointerToSourceByte |
837 TUint firstByte = (*pointerToSourceByte |
1657 |
|
1658 - KFirstByteRangeFirstBlockStart) / 2 + sjisStartbyte; |
838 - KFirstByteRangeFirstBlockStart) / 2 + sjisStartbyte; |
1659 |
|
1660 TUint secondByte = *(pointerToSourceByte + 1); |
839 TUint secondByte = *(pointerToSourceByte + 1); |
1661 |
|
1662 if ((*pointerToSourceByte % 2) == 0) |
840 if ((*pointerToSourceByte % 2) == 0) |
1663 |
841 { |
1664 { |
|
1665 |
|
1666 secondByte += KPictographStartSecondByte - |
842 secondByte += KPictographStartSecondByte - |
1667 |
|
1668 KSecondByteRangeSecondBlockStart + KEUCJPBlockSize + 1; |
843 KSecondByteRangeSecondBlockStart + KEUCJPBlockSize + 1; |
1669 |
|
1670 if (secondByte >= KShiftJisTrailByteIllegal) |
844 if (secondByte >= KShiftJisTrailByteIllegal) |
1671 |
|
1672 secondByte++; |
845 secondByte++; |
1673 |
846 } |
1674 } |
|
1675 |
|
1676 else |
847 else |
1677 |
848 { |
1678 { |
|
1679 |
|
1680 secondByte += KPictographStartSecondByte - KSecondByteRangeSecondBlockStart; |
849 secondByte += KPictographStartSecondByte - KSecondByteRangeSecondBlockStart; |
1681 |
|
1682 if (secondByte >= KShiftJisTrailByteIllegal) |
850 if (secondByte >= KShiftJisTrailByteIllegal) |
1683 |
|
1684 secondByte++; |
851 secondByte++; |
1685 |
852 } |
1686 } |
|
1687 |
|
1688 *pointerToTargetByte = static_cast<TUint8>(firstByte); |
853 *pointerToTargetByte = static_cast<TUint8>(firstByte); |
1689 |
854 |
1690 |
|
1691 |
|
1692 __ASSERT_DEBUG(pointerToTargetByte < pointerToLastByte, |
855 __ASSERT_DEBUG(pointerToTargetByte < pointerToLastByte, |
1693 |
|
1694 Panic(EPanicBadPointers35)); |
856 Panic(EPanicBadPointers35)); |
1695 |
|
1696 ++pointerToTargetByte; |
857 ++pointerToTargetByte; |
1697 |
|
1698 *pointerToTargetByte = static_cast<TUint8>(secondByte); |
858 *pointerToTargetByte = static_cast<TUint8>(secondByte); |
1699 |
|
1700 __ASSERT_DEBUG(pointerToSourceByte <= pointerToLastByte, |
859 __ASSERT_DEBUG(pointerToSourceByte <= pointerToLastByte, |
1701 |
|
1702 Panic(EPanicBadPointers36)); |
860 Panic(EPanicBadPointers36)); |
1703 |
|
1704 pointerToSourceByte += 2; |
861 pointerToSourceByte += 2; |
1705 |
|
1706 ++pointerToTargetByte; |
862 ++pointerToTargetByte; |
1707 |
863 } |
1708 } |
|
1709 |
|
1710 aDescriptor.SetLength((descriptorLength / bytesPerCharacter) * 2); |
864 aDescriptor.SetLength((descriptorLength / bytesPerCharacter) * 2); |
1711 |
865 } |
1712 } |
|
1713 |
|
1714 |
|
1715 |
866 |
1716 // New Interface class |
867 // New Interface class |
1717 |
|
1718 class CEucJpDirectmapImplementation : public CCharacterSetConverterPluginInterface |
868 class CEucJpDirectmapImplementation : public CCharacterSetConverterPluginInterface |
1719 |
|
1720 { |
869 { |
1721 |
|
1722 public: |
870 public: |
1723 |
|
1724 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters(); |
871 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters(); |
1725 |
872 |
1726 |
|
1727 |
|
1728 virtual TInt ConvertFromUnicode( |
873 virtual TInt ConvertFromUnicode( |
1729 |
|
1730 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
874 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
1731 |
|
1732 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, |
875 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, |
1733 |
|
1734 TDes8& aForeign, |
876 TDes8& aForeign, |
1735 |
|
1736 const TDesC16& aUnicode, |
877 const TDesC16& aUnicode, |
1737 |
|
1738 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters ); |
878 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters ); |
1739 |
879 |
1740 |
|
1741 |
|
1742 virtual TInt ConvertToUnicode( |
880 virtual TInt ConvertToUnicode( |
1743 |
|
1744 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
881 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
1745 |
|
1746 TDes16& aUnicode, |
882 TDes16& aUnicode, |
1747 |
|
1748 const TDesC8& aForeign, |
883 const TDesC8& aForeign, |
1749 |
|
1750 TInt&, |
884 TInt&, |
1751 |
|
1752 TInt& aNumberOfUnconvertibleCharacters, |
885 TInt& aNumberOfUnconvertibleCharacters, |
1753 |
|
1754 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter ); |
886 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter ); |
1755 |
887 |
1756 |
|
1757 |
|
1758 virtual TBool IsInThisCharacterSetL( |
888 virtual TBool IsInThisCharacterSetL( |
1759 |
|
1760 TBool& aSetToTrue, |
889 TBool& aSetToTrue, |
1761 |
|
1762 TInt& aConfidenceLevel, |
890 TInt& aConfidenceLevel, |
1763 |
|
1764 const TDesC8& ); |
891 const TDesC8& ); |
1765 |
892 |
1766 |
|
1767 |
|
1768 static CEucJpDirectmapImplementation* NewL(); |
893 static CEucJpDirectmapImplementation* NewL(); |
1769 |
894 |
1770 |
|
1771 |
|
1772 virtual ~CEucJpDirectmapImplementation(); |
895 virtual ~CEucJpDirectmapImplementation(); |
1773 |
|
1774 private: |
896 private: |
1775 |
|
1776 CEucJpDirectmapImplementation(); |
897 CEucJpDirectmapImplementation(); |
1777 |
|
1778 }; |
898 }; |
1779 |
899 |
1780 |
900 // ----------------------------------------------------------------------------- |
1781 |
|
1782 // ----------------------------------------------------------------------------- |
|
1783 |
|
1784 // ReplacementForUnconvertibleUnicodeCharacters |
901 // ReplacementForUnconvertibleUnicodeCharacters |
1785 |
|
1786 // Retruns the character to replacement for unconvertible unicode character. |
902 // Retruns the character to replacement for unconvertible unicode character. |
1787 |
|
1788 // Returns: '?': |
903 // Returns: '?': |
1789 |
904 // ----------------------------------------------------------------------------- |
1790 // ----------------------------------------------------------------------------- |
905 // |
1791 |
|
1792 // |
|
1793 |
|
1794 const TDesC8& CEucJpDirectmapImplementation::ReplacementForUnconvertibleUnicodeCharacters() |
906 const TDesC8& CEucJpDirectmapImplementation::ReplacementForUnconvertibleUnicodeCharacters() |
1795 |
907 { |
1796 { |
|
1797 |
|
1798 return KLit8EucJpPackedReplacementForUnconvertibleUnicodeCharacters; |
908 return KLit8EucJpPackedReplacementForUnconvertibleUnicodeCharacters; |
1799 |
909 } |
1800 } |
910 |
1801 |
911 // ----------------------------------------------------------------------------- |
1802 |
|
1803 |
|
1804 // ----------------------------------------------------------------------------- |
|
1805 |
|
1806 // ConvertFromUnicode |
912 // ConvertFromUnicode |
1807 |
|
1808 // Converts from Unicode to EUC-JP |
913 // Converts from Unicode to EUC-JP |
1809 |
|
1810 // Returns: The number of unconverted characters |
914 // Returns: The number of unconverted characters |
1811 |
915 // ----------------------------------------------------------------------------- |
1812 // ----------------------------------------------------------------------------- |
916 // |
1813 |
|
1814 // |
|
1815 |
|
1816 TInt CEucJpDirectmapImplementation::ConvertFromUnicode( |
917 TInt CEucJpDirectmapImplementation::ConvertFromUnicode( |
1817 |
|
1818 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
918 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
1819 |
|
1820 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, |
919 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, |
1821 |
|
1822 TDes8& aForeign, const TDesC16& aUnicode, |
920 TDes8& aForeign, const TDesC16& aUnicode, |
1823 |
|
1824 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters) |
921 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters) |
1825 |
922 { |
1826 { |
|
1827 |
|
1828 TFixedArray<CnvUtilities::SCharacterSet, 6> characterSets; |
923 TFixedArray<CnvUtilities::SCharacterSet, 6> characterSets; |
1829 |
|
1830 characterSets[0].iConversionData = &CnvJisRoman::ConversionData(); |
924 characterSets[0].iConversionData = &CnvJisRoman::ConversionData(); |
1831 |
|
1832 characterSets[0].iConvertFromIntermediateBufferInPlace = |
925 characterSets[0].iConvertFromIntermediateBufferInPlace = |
1833 |
|
1834 DummyConvertFromIntermediateBufferInPlace; |
926 DummyConvertFromIntermediateBufferInPlace; |
1835 |
|
1836 characterSets[0].iEscapeSequence = &KNullDesC8; |
927 characterSets[0].iEscapeSequence = &KNullDesC8; |
1837 |
|
1838 characterSets[1].iConversionData = &CnvJisX0208::ConversionData(); |
928 characterSets[1].iConversionData = &CnvJisX0208::ConversionData(); |
1839 |
|
1840 characterSets[1].iConvertFromIntermediateBufferInPlace = |
929 characterSets[1].iConvertFromIntermediateBufferInPlace = |
1841 |
|
1842 ConvertFromJisX0208ToEucJpPackedInPlace; |
930 ConvertFromJisX0208ToEucJpPackedInPlace; |
1843 |
|
1844 characterSets[1].iEscapeSequence = &KNullDesC8; |
931 characterSets[1].iEscapeSequence = &KNullDesC8; |
1845 |
|
1846 characterSets[2].iConversionData = &CnvHalfWidthKatakana8::ConversionData(); |
932 characterSets[2].iConversionData = &CnvHalfWidthKatakana8::ConversionData(); |
1847 |
|
1848 characterSets[2].iConvertFromIntermediateBufferInPlace = |
933 characterSets[2].iConvertFromIntermediateBufferInPlace = |
1849 |
|
1850 ConvertFromHalfWidthKatakana8ToEucJpPackedInPlace; |
934 ConvertFromHalfWidthKatakana8ToEucJpPackedInPlace; |
1851 |
|
1852 characterSets[2].iEscapeSequence = &KNullDesC8; |
935 characterSets[2].iEscapeSequence = &KNullDesC8; |
1853 |
|
1854 characterSets[3].iConversionData = &CnvJisX0212::ConversionData(); |
936 characterSets[3].iConversionData = &CnvJisX0212::ConversionData(); |
1855 |
|
1856 characterSets[3].iConvertFromIntermediateBufferInPlace = |
937 characterSets[3].iConvertFromIntermediateBufferInPlace = |
1857 |
|
1858 ConvertFromJisX0212ToEucJpPackedInPlace; |
938 ConvertFromJisX0212ToEucJpPackedInPlace; |
1859 |
|
1860 characterSets[3].iEscapeSequence = &KNullDesC8; |
939 characterSets[3].iEscapeSequence = &KNullDesC8; |
1861 |
|
1862 characterSets[4].iConversionData = &CnvShiftJisDirectmap::ConversionData(); |
940 characterSets[4].iConversionData = &CnvShiftJisDirectmap::ConversionData(); |
1863 |
|
1864 characterSets[4].iConvertFromIntermediateBufferInPlace = |
941 characterSets[4].iConvertFromIntermediateBufferInPlace = |
1865 |
|
1866 ConvertFromPictogaphToEucJpDirectmapInPlace; |
942 ConvertFromPictogaphToEucJpDirectmapInPlace; |
1867 |
|
1868 characterSets[4].iEscapeSequence = &KNullDesC8; |
943 characterSets[4].iEscapeSequence = &KNullDesC8; |
1869 |
|
1870 characterSets[5].iConversionData = &CnvShiftJisDirectmap::ConversionData(); |
944 characterSets[5].iConversionData = &CnvShiftJisDirectmap::ConversionData(); |
1871 |
|
1872 characterSets[5].iConvertFromIntermediateBufferInPlace = |
945 characterSets[5].iConvertFromIntermediateBufferInPlace = |
1873 |
|
1874 ConvertFromPictogaphToEucJpDirectmapInPlace; |
946 ConvertFromPictogaphToEucJpDirectmapInPlace; |
1875 |
|
1876 characterSets[5].iEscapeSequence = &KNullDesC8; |
947 characterSets[5].iEscapeSequence = &KNullDesC8; |
1877 |
948 |
1878 |
|
1879 |
|
1880 TInt unconvert = CnvUtilities::ConvertFromUnicode( |
949 TInt unconvert = CnvUtilities::ConvertFromUnicode( |
1881 |
|
1882 aDefaultEndiannessOfForeignCharacters, |
950 aDefaultEndiannessOfForeignCharacters, |
1883 |
|
1884 aReplacementForUnconvertibleUnicodeCharacters, |
951 aReplacementForUnconvertibleUnicodeCharacters, |
1885 |
|
1886 aForeign, aUnicode, aIndicesOfUnconvertibleCharacters, |
952 aForeign, aUnicode, aIndicesOfUnconvertibleCharacters, |
1887 |
|
1888 characterSets.Array()); |
953 characterSets.Array()); |
1889 |
954 |
1890 |
|
1891 |
|
1892 return unconvert; |
955 return unconvert; |
1893 |
956 } |
1894 } |
957 |
1895 |
958 // ----------------------------------------------------------------------------- |
1896 |
|
1897 |
|
1898 // ----------------------------------------------------------------------------- |
|
1899 |
|
1900 // ConvertToUnicode |
959 // ConvertToUnicode |
1901 |
|
1902 // Converts from EUC-JP to Unicode. |
960 // Converts from EUC-JP to Unicode. |
1903 |
|
1904 // Returns: The number of unconverted bytes |
961 // Returns: The number of unconverted bytes |
1905 |
962 // ----------------------------------------------------------------------------- |
1906 // ----------------------------------------------------------------------------- |
963 // |
1907 |
|
1908 // |
|
1909 |
|
1910 TInt CEucJpDirectmapImplementation::ConvertToUnicode( |
964 TInt CEucJpDirectmapImplementation::ConvertToUnicode( |
1911 |
|
1912 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
965 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
1913 |
|
1914 TDes16& aUnicode, const TDesC8& aForeign, TInt&, |
966 TDes16& aUnicode, const TDesC8& aForeign, TInt&, |
1915 |
|
1916 TInt& aNumberOfUnconvertibleCharacters, |
967 TInt& aNumberOfUnconvertibleCharacters, |
1917 |
|
1918 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter) |
968 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter) |
1919 |
969 { |
1920 { |
|
1921 |
|
1922 TFixedArray<CnvUtilities::SMethod, 6> methods; |
970 TFixedArray<CnvUtilities::SMethod, 6> methods; |
1923 |
971 |
1924 |
|
1925 |
|
1926 methods[0].iNumberOfBytesAbleToConvert = |
972 methods[0].iNumberOfBytesAbleToConvert = |
1927 |
|
1928 NumberOfBytesAbleToConvertToPictograph1; |
973 NumberOfBytesAbleToConvertToPictograph1; |
1929 |
|
1930 methods[0].iConvertToIntermediateBufferInPlace = |
974 methods[0].iConvertToIntermediateBufferInPlace = |
1931 |
|
1932 ConvertToPictographFromEucJpPackedInPlace; |
975 ConvertToPictographFromEucJpPackedInPlace; |
1933 |
|
1934 methods[0].iConversionData = &CnvShiftJisDirectmap::ConversionData(); |
976 methods[0].iConversionData = &CnvShiftJisDirectmap::ConversionData(); |
1935 |
|
1936 methods[0].iNumberOfBytesPerCharacter = 2; |
977 methods[0].iNumberOfBytesPerCharacter = 2; |
1937 |
|
1938 methods[0].iNumberOfCoreBytesPerCharacter = 2; |
978 methods[0].iNumberOfCoreBytesPerCharacter = 2; |
1939 |
|
1940 methods[1].iNumberOfBytesAbleToConvert = |
979 methods[1].iNumberOfBytesAbleToConvert = |
1941 |
|
1942 NumberOfBytesAbleToConvertToPictograph2; |
980 NumberOfBytesAbleToConvertToPictograph2; |
1943 |
|
1944 methods[1].iConvertToIntermediateBufferInPlace = |
981 methods[1].iConvertToIntermediateBufferInPlace = |
1945 |
|
1946 ConvertToPictographFromEucJpPackedInPlace; |
982 ConvertToPictographFromEucJpPackedInPlace; |
1947 |
|
1948 methods[1].iConversionData = &CnvShiftJisDirectmap::ConversionData(); |
983 methods[1].iConversionData = &CnvShiftJisDirectmap::ConversionData(); |
1949 |
|
1950 methods[1].iNumberOfBytesPerCharacter = 3; |
984 methods[1].iNumberOfBytesPerCharacter = 3; |
1951 |
|
1952 methods[1].iNumberOfCoreBytesPerCharacter = 2; |
985 methods[1].iNumberOfCoreBytesPerCharacter = 2; |
1953 |
986 |
1954 |
|
1955 |
|
1956 methods[2].iNumberOfBytesAbleToConvert = NumberOfBytesAbleToConvertToJisRoman; |
987 methods[2].iNumberOfBytesAbleToConvert = NumberOfBytesAbleToConvertToJisRoman; |
1957 |
|
1958 methods[2].iConvertToIntermediateBufferInPlace = |
988 methods[2].iConvertToIntermediateBufferInPlace = |
1959 |
|
1960 DummyConvertToIntermediateBufferInPlace; |
989 DummyConvertToIntermediateBufferInPlace; |
1961 |
|
1962 methods[2].iConversionData = &CnvJisRoman::ConversionData(); |
990 methods[2].iConversionData = &CnvJisRoman::ConversionData(); |
1963 |
|
1964 methods[2].iNumberOfBytesPerCharacter = 1; |
991 methods[2].iNumberOfBytesPerCharacter = 1; |
1965 |
|
1966 methods[2].iNumberOfCoreBytesPerCharacter = 1; |
992 methods[2].iNumberOfCoreBytesPerCharacter = 1; |
1967 |
|
1968 methods[3].iNumberOfBytesAbleToConvert = NumberOfBytesAbleToConvertToJisX0208; |
993 methods[3].iNumberOfBytesAbleToConvert = NumberOfBytesAbleToConvertToJisX0208; |
1969 |
|
1970 methods[3].iConvertToIntermediateBufferInPlace = |
994 methods[3].iConvertToIntermediateBufferInPlace = |
1971 |
|
1972 ConvertToJisX0208FromEucJpPackedInPlace; |
995 ConvertToJisX0208FromEucJpPackedInPlace; |
1973 |
|
1974 methods[3].iConversionData = &CnvJisX0208::ConversionData(); |
996 methods[3].iConversionData = &CnvJisX0208::ConversionData(); |
1975 |
|
1976 methods[3].iNumberOfBytesPerCharacter = 2; |
997 methods[3].iNumberOfBytesPerCharacter = 2; |
1977 |
|
1978 methods[3].iNumberOfCoreBytesPerCharacter = 2; |
998 methods[3].iNumberOfCoreBytesPerCharacter = 2; |
1979 |
|
1980 methods[4].iNumberOfBytesAbleToConvert = |
999 methods[4].iNumberOfBytesAbleToConvert = |
1981 |
|
1982 NumberOfBytesAbleToConvertToHalfWidthKatakana8; |
1000 NumberOfBytesAbleToConvertToHalfWidthKatakana8; |
1983 |
|
1984 methods[4].iConvertToIntermediateBufferInPlace = |
1001 methods[4].iConvertToIntermediateBufferInPlace = |
1985 |
|
1986 ConvertToHalfWidthKatakana8FromEucJpPackedInPlace; |
1002 ConvertToHalfWidthKatakana8FromEucJpPackedInPlace; |
1987 |
|
1988 methods[4].iConversionData = &CnvHalfWidthKatakana8::ConversionData(); |
1003 methods[4].iConversionData = &CnvHalfWidthKatakana8::ConversionData(); |
1989 |
|
1990 methods[4].iNumberOfBytesPerCharacter = 2; |
1004 methods[4].iNumberOfBytesPerCharacter = 2; |
1991 |
|
1992 methods[4].iNumberOfCoreBytesPerCharacter = 1; |
1005 methods[4].iNumberOfCoreBytesPerCharacter = 1; |
1993 |
|
1994 methods[5].iNumberOfBytesAbleToConvert = |
1006 methods[5].iNumberOfBytesAbleToConvert = |
1995 |
|
1996 NumberOfBytesAbleToConvertToJisX0212; |
1007 NumberOfBytesAbleToConvertToJisX0212; |
1997 |
|
1998 methods[5].iConvertToIntermediateBufferInPlace = |
1008 methods[5].iConvertToIntermediateBufferInPlace = |
1999 |
|
2000 ConvertToJisX0212FromEucJpPackedInPlace; |
1009 ConvertToJisX0212FromEucJpPackedInPlace; |
2001 |
|
2002 methods[5].iConversionData = &CnvJisX0212::ConversionData(); |
1010 methods[5].iConversionData = &CnvJisX0212::ConversionData(); |
2003 |
|
2004 methods[5].iNumberOfBytesPerCharacter = 3; |
1011 methods[5].iNumberOfBytesPerCharacter = 3; |
2005 |
|
2006 methods[5].iNumberOfCoreBytesPerCharacter = 2; |
1012 methods[5].iNumberOfCoreBytesPerCharacter = 2; |
2007 |
1013 |
2008 |
|
2009 |
|
2010 TInt unconvert = CnvUtilities::ConvertToUnicodeFromHeterogeneousForeign( |
1014 TInt unconvert = CnvUtilities::ConvertToUnicodeFromHeterogeneousForeign( |
2011 |
|
2012 aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, |
1015 aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, |
2013 |
|
2014 aNumberOfUnconvertibleCharacters, |
1016 aNumberOfUnconvertibleCharacters, |
2015 |
|
2016 aIndexOfFirstByteOfFirstUnconvertibleCharacter, methods.Array()); |
1017 aIndexOfFirstByteOfFirstUnconvertibleCharacter, methods.Array()); |
2017 |
1018 |
2018 |
|
2019 |
|
2020 // The following is specific impelementation for brower. |
1019 // The following is specific impelementation for brower. |
2021 |
|
2022 // If brower app calls this API, the yen sign code(0xA5) |
1020 // If brower app calls this API, the yen sign code(0xA5) |
2023 |
|
2024 // must be converted to backslash code(0x5C). |
1021 // must be converted to backslash code(0x5C). |
2025 |
|
2026 // Becasue Javascript supports backslash code ony. |
1022 // Becasue Javascript supports backslash code ony. |
2027 |
|
2028 TBool browserProcess = (RProcess().SecureId().iId == KBrowserSecureId); |
1023 TBool browserProcess = (RProcess().SecureId().iId == KBrowserSecureId); |
2029 |
|
2030 if (browserProcess && aUnicode.Length() > 0) |
1024 if (browserProcess && aUnicode.Length() > 0) |
2031 |
1025 { |
2032 { |
|
2033 |
|
2034 const TUint16* pB = aUnicode.Ptr(); |
1026 const TUint16* pB = aUnicode.Ptr(); |
2035 |
|
2036 const TUint16* pbase = pB; |
1027 const TUint16* pbase = pB; |
2037 |
|
2038 const TUint16* pE = pB + aUnicode.Length() -1; |
1028 const TUint16* pE = pB + aUnicode.Length() -1; |
2039 |
|
2040 while (pE>=pbase) |
1029 while (pE>=pbase) |
2041 |
1030 { |
2042 { |
|
2043 |
|
2044 if (*pbase == KCharacterCodeForYenSign) |
1031 if (*pbase == KCharacterCodeForYenSign) |
2045 |
|
2046 { |
1032 { |
2047 |
|
2048 aUnicode[pbase - pB] = KCharacterCodeForBackSlash; |
1033 aUnicode[pbase - pB] = KCharacterCodeForBackSlash; |
2049 |
|
2050 } |
1034 } |
2051 |
|
2052 pbase++; |
1035 pbase++; |
2053 |
1036 } |
2054 } |
1037 } |
2055 |
|
2056 } |
|
2057 |
|
2058 |
|
2059 |
1038 |
2060 return unconvert; |
1039 return unconvert; |
2061 |
1040 } |
2062 } |
1041 |
2063 |
1042 // ----------------------------------------------------------------------------- |
2064 |
|
2065 |
|
2066 // ----------------------------------------------------------------------------- |
|
2067 |
|
2068 // IsInThisCharacterSetL |
1043 // IsInThisCharacterSetL |
2069 |
|
2070 // Detects whether the text is the character code or not. |
1044 // Detects whether the text is the character code or not. |
2071 |
|
2072 // Returns: ETrue: |
1045 // Returns: ETrue: |
2073 |
1046 // ----------------------------------------------------------------------------- |
2074 // ----------------------------------------------------------------------------- |
1047 // |
2075 |
|
2076 // |
|
2077 |
|
2078 TBool CEucJpDirectmapImplementation::IsInThisCharacterSetL(TBool& /*aSetToTrue*/, TInt& /*aConfidenceLevel*/, |
1048 TBool CEucJpDirectmapImplementation::IsInThisCharacterSetL(TBool& /*aSetToTrue*/, TInt& /*aConfidenceLevel*/, |
2079 |
|
2080 const TDesC8& /*aSample*/) |
1049 const TDesC8& /*aSample*/) |
2081 |
1050 { |
2082 { |
|
2083 |
|
2084 return EFalse; |
1051 return EFalse; |
2085 |
1052 } |
2086 } |
|
2087 |
|
2088 |
|
2089 |
1053 |
2090 CEucJpDirectmapImplementation* CEucJpDirectmapImplementation::NewL() |
1054 CEucJpDirectmapImplementation* CEucJpDirectmapImplementation::NewL() |
2091 |
1055 { |
2092 { |
|
2093 |
|
2094 CEucJpDirectmapImplementation* self = new(ELeave) CEucJpDirectmapImplementation; |
1056 CEucJpDirectmapImplementation* self = new(ELeave) CEucJpDirectmapImplementation; |
2095 |
|
2096 return self; |
1057 return self; |
2097 |
1058 } |
2098 } |
|
2099 |
|
2100 |
|
2101 |
1059 |
2102 CEucJpDirectmapImplementation::CEucJpDirectmapImplementation() |
1060 CEucJpDirectmapImplementation::CEucJpDirectmapImplementation() |
2103 |
1061 { |
2104 { |
|
2105 |
|
2106 //default constructor.. do nothing |
1062 //default constructor.. do nothing |
2107 |
1063 } |
2108 } |
|
2109 |
|
2110 |
|
2111 |
1064 |
2112 CEucJpDirectmapImplementation::~CEucJpDirectmapImplementation() |
1065 CEucJpDirectmapImplementation::~CEucJpDirectmapImplementation() |
2113 |
1066 { |
2114 { |
|
2115 |
|
2116 //default destructor .. do nothing |
1067 //default destructor .. do nothing |
2117 |
1068 } |
2118 } |
|
2119 |
|
2120 |
|
2121 |
1069 |
2122 // ECOM CREATION FUNCTION |
1070 // ECOM CREATION FUNCTION |
2123 |
|
2124 const TImplementationProxy ImplementationTable[] = |
1071 const TImplementationProxy ImplementationTable[] = |
2125 |
1072 { |
2126 { |
|
2127 |
|
2128 // Note: This is the same UID as defined in old mmp-file |
1073 // Note: This is the same UID as defined in old mmp-file |
2129 |
|
2130 // Used also in 12221212.rss ( implementation_uid ) |
1074 // Used also in 12221212.rss ( implementation_uid ) |
2131 |
|
2132 IMPLEMENTATION_PROXY_ENTRY( 0x101F86A6, CEucJpDirectmapImplementation::NewL ) |
1075 IMPLEMENTATION_PROXY_ENTRY( 0x101F86A6, CEucJpDirectmapImplementation::NewL ) |
2133 |
|
2134 }; |
1076 }; |
2135 |
1077 |
2136 |
|
2137 |
|
2138 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) |
1078 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) |
2139 |
1079 { |
2140 { |
|
2141 |
|
2142 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy); |
1080 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy); |
2143 |
|
2144 return ImplementationTable; |
1081 return ImplementationTable; |
2145 |
1082 } |
2146 } |
|
2147 |
|
2148 |
|
2149 |
1083 |
2150 // End of file |
1084 // End of file |
2151 |
|