sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <e32std.h>
|
sl@0
|
20 |
#include <convdata.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
#define ARRAY_LENGTH(aArray) (sizeof(aArray)/sizeof((aArray)[0]))
|
sl@0
|
23 |
|
sl@0
|
24 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_1[]=
|
sl@0
|
25 |
{
|
sl@0
|
26 |
0x0040,
|
sl@0
|
27 |
0x00a3,
|
sl@0
|
28 |
0x0024,
|
sl@0
|
29 |
0x00a5,
|
sl@0
|
30 |
0x00e8,
|
sl@0
|
31 |
0x00e9,
|
sl@0
|
32 |
0x00f9,
|
sl@0
|
33 |
0x00ec,
|
sl@0
|
34 |
0x00f2,
|
sl@0
|
35 |
0x00e7,
|
sl@0
|
36 |
0x000a,
|
sl@0
|
37 |
0x00d8,
|
sl@0
|
38 |
0x00f8,
|
sl@0
|
39 |
0x000d,
|
sl@0
|
40 |
0x00c5,
|
sl@0
|
41 |
0x00e5,
|
sl@0
|
42 |
0x0394,
|
sl@0
|
43 |
0x005f,
|
sl@0
|
44 |
0x03a6,
|
sl@0
|
45 |
0x0393,
|
sl@0
|
46 |
0x039b,
|
sl@0
|
47 |
0x03a9,
|
sl@0
|
48 |
0x03a0,
|
sl@0
|
49 |
0x03a8,
|
sl@0
|
50 |
0x03a3,
|
sl@0
|
51 |
0x0398,
|
sl@0
|
52 |
0x039e
|
sl@0
|
53 |
};
|
sl@0
|
54 |
|
sl@0
|
55 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_2[]=
|
sl@0
|
56 |
{
|
sl@0
|
57 |
0x00c6,
|
sl@0
|
58 |
0x00e6,
|
sl@0
|
59 |
0x00df,
|
sl@0
|
60 |
0x00c9,
|
sl@0
|
61 |
0x0020,
|
sl@0
|
62 |
0x0021,
|
sl@0
|
63 |
0x0022,
|
sl@0
|
64 |
0x0023,
|
sl@0
|
65 |
0x00a4
|
sl@0
|
66 |
};
|
sl@0
|
67 |
|
sl@0
|
68 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_3[]=
|
sl@0
|
69 |
{
|
sl@0
|
70 |
0x00c4,
|
sl@0
|
71 |
0x00d6,
|
sl@0
|
72 |
0x00d1,
|
sl@0
|
73 |
0x00dc,
|
sl@0
|
74 |
0x00a7,
|
sl@0
|
75 |
0x00bf
|
sl@0
|
76 |
};
|
sl@0
|
77 |
|
sl@0
|
78 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_4[]=
|
sl@0
|
79 |
{
|
sl@0
|
80 |
0x00e4,
|
sl@0
|
81 |
0x00f6,
|
sl@0
|
82 |
0x00f1,
|
sl@0
|
83 |
0x00fc,
|
sl@0
|
84 |
0x00e0
|
sl@0
|
85 |
};
|
sl@0
|
86 |
|
sl@0
|
87 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_5[]=
|
sl@0
|
88 |
{
|
sl@0
|
89 |
0x0040,
|
sl@0
|
90 |
0x00a3,
|
sl@0
|
91 |
0x0024,
|
sl@0
|
92 |
0x00a5,
|
sl@0
|
93 |
0x00e8,
|
sl@0
|
94 |
0x00e9,
|
sl@0
|
95 |
0x00f9,
|
sl@0
|
96 |
0x00ec,
|
sl@0
|
97 |
0x00f2,
|
sl@0
|
98 |
0x00c7,
|
sl@0
|
99 |
0x000c, // meant to be a "Page Break" - a FORM FEED character is the nearest thing in Unicode to this
|
sl@0
|
100 |
0x00d8,
|
sl@0
|
101 |
0x00f8,
|
sl@0
|
102 |
0x000d,
|
sl@0
|
103 |
0x00c5,
|
sl@0
|
104 |
0x00e5,
|
sl@0
|
105 |
0x0394,
|
sl@0
|
106 |
0x005f,
|
sl@0
|
107 |
0x03a6,
|
sl@0
|
108 |
0x0393,
|
sl@0
|
109 |
0x005e, // '^'
|
sl@0
|
110 |
0x03a9,
|
sl@0
|
111 |
0x03a0,
|
sl@0
|
112 |
0x03a8,
|
sl@0
|
113 |
0x03a3,
|
sl@0
|
114 |
0x0398,
|
sl@0
|
115 |
0x039e
|
sl@0
|
116 |
};
|
sl@0
|
117 |
|
sl@0
|
118 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_6[]=
|
sl@0
|
119 |
{
|
sl@0
|
120 |
0x00c6,
|
sl@0
|
121 |
0x00e6,
|
sl@0
|
122 |
0x00df,
|
sl@0
|
123 |
0x00c9,
|
sl@0
|
124 |
0x0020,
|
sl@0
|
125 |
0x0021,
|
sl@0
|
126 |
0x0022,
|
sl@0
|
127 |
0x0023,
|
sl@0
|
128 |
0x00a4,
|
sl@0
|
129 |
0x0025,
|
sl@0
|
130 |
0x0026,
|
sl@0
|
131 |
0x0027,
|
sl@0
|
132 |
0x007b, // '{'
|
sl@0
|
133 |
0x007d, // '}'
|
sl@0
|
134 |
0x002a,
|
sl@0
|
135 |
0x002b,
|
sl@0
|
136 |
0x002c,
|
sl@0
|
137 |
0x002d,
|
sl@0
|
138 |
0x002e,
|
sl@0
|
139 |
0x005c, // '\'
|
sl@0
|
140 |
0x0030,
|
sl@0
|
141 |
0x0031,
|
sl@0
|
142 |
0x0032,
|
sl@0
|
143 |
0x0033,
|
sl@0
|
144 |
0x0034,
|
sl@0
|
145 |
0x0035,
|
sl@0
|
146 |
0x0036,
|
sl@0
|
147 |
0x0037,
|
sl@0
|
148 |
0x0038,
|
sl@0
|
149 |
0x0039,
|
sl@0
|
150 |
0x003a,
|
sl@0
|
151 |
0x003b,
|
sl@0
|
152 |
0x005b, // '['
|
sl@0
|
153 |
0x007e, // '~'
|
sl@0
|
154 |
0x005d, // ']'
|
sl@0
|
155 |
0x003f,
|
sl@0
|
156 |
0x007c // '|'
|
sl@0
|
157 |
};
|
sl@0
|
158 |
|
sl@0
|
159 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_7[]=
|
sl@0
|
160 |
{
|
sl@0
|
161 |
0x00c4,
|
sl@0
|
162 |
0x00d6,
|
sl@0
|
163 |
0x00d1,
|
sl@0
|
164 |
0x00dc,
|
sl@0
|
165 |
0x00a7,
|
sl@0
|
166 |
0x00bf,
|
sl@0
|
167 |
0x0061,
|
sl@0
|
168 |
0x0062,
|
sl@0
|
169 |
0x0063,
|
sl@0
|
170 |
0x0064,
|
sl@0
|
171 |
0x20ac // Euro symbol
|
sl@0
|
172 |
};
|
sl@0
|
173 |
|
sl@0
|
174 |
LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry keyedTables16OfIndexedTables16_keyedEntries_sms7BitToUnicode_1[]=
|
sl@0
|
175 |
{
|
sl@0
|
176 |
{
|
sl@0
|
177 |
0x00,
|
sl@0
|
178 |
0x1a,
|
sl@0
|
179 |
keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_1
|
sl@0
|
180 |
},
|
sl@0
|
181 |
{
|
sl@0
|
182 |
0x1c,
|
sl@0
|
183 |
0x24,
|
sl@0
|
184 |
keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_2
|
sl@0
|
185 |
},
|
sl@0
|
186 |
{
|
sl@0
|
187 |
0x5b,
|
sl@0
|
188 |
0x60,
|
sl@0
|
189 |
keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_3
|
sl@0
|
190 |
},
|
sl@0
|
191 |
{
|
sl@0
|
192 |
0x7b,
|
sl@0
|
193 |
0x7f,
|
sl@0
|
194 |
keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_4
|
sl@0
|
195 |
}
|
sl@0
|
196 |
};
|
sl@0
|
197 |
|
sl@0
|
198 |
LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry keyedTables16OfIndexedTables16_keyedEntries_sms7BitToUnicode_2[]=
|
sl@0
|
199 |
{
|
sl@0
|
200 |
{
|
sl@0
|
201 |
0x1b00,
|
sl@0
|
202 |
0x1b1a,
|
sl@0
|
203 |
keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_5
|
sl@0
|
204 |
},
|
sl@0
|
205 |
{
|
sl@0
|
206 |
0x1b1c,
|
sl@0
|
207 |
0x1b40,
|
sl@0
|
208 |
keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_6
|
sl@0
|
209 |
},
|
sl@0
|
210 |
{
|
sl@0
|
211 |
0x1b5b,
|
sl@0
|
212 |
0x1b65,
|
sl@0
|
213 |
keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_7
|
sl@0
|
214 |
},
|
sl@0
|
215 |
{
|
sl@0
|
216 |
0x1b7b,
|
sl@0
|
217 |
0x1b7f,
|
sl@0
|
218 |
keyedTables16OfIndexedTables16_indexedEntries_sms7BitToUnicode_4
|
sl@0
|
219 |
}
|
sl@0
|
220 |
};
|
sl@0
|
221 |
|
sl@0
|
222 |
#if 0
|
sl@0
|
223 |
LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry keyedTable1616_sms7BitToUnicode_1[]=
|
sl@0
|
224 |
{
|
sl@0
|
225 |
{
|
sl@0
|
226 |
0x1b0a,
|
sl@0
|
227 |
0x000c
|
sl@0
|
228 |
},
|
sl@0
|
229 |
{
|
sl@0
|
230 |
0x1b14,
|
sl@0
|
231 |
0x005e
|
sl@0
|
232 |
},
|
sl@0
|
233 |
{
|
sl@0
|
234 |
0x1b28,
|
sl@0
|
235 |
0x007b
|
sl@0
|
236 |
},
|
sl@0
|
237 |
{
|
sl@0
|
238 |
0x1b29,
|
sl@0
|
239 |
0x007d
|
sl@0
|
240 |
},
|
sl@0
|
241 |
{
|
sl@0
|
242 |
0x1b2f,
|
sl@0
|
243 |
0x005c
|
sl@0
|
244 |
},
|
sl@0
|
245 |
{
|
sl@0
|
246 |
0x1b3c,
|
sl@0
|
247 |
0x005b
|
sl@0
|
248 |
},
|
sl@0
|
249 |
{
|
sl@0
|
250 |
0x1b3d,
|
sl@0
|
251 |
0x007e
|
sl@0
|
252 |
},
|
sl@0
|
253 |
{
|
sl@0
|
254 |
0x1b3e,
|
sl@0
|
255 |
0x005d
|
sl@0
|
256 |
},
|
sl@0
|
257 |
{
|
sl@0
|
258 |
0x1b40,
|
sl@0
|
259 |
0x007c
|
sl@0
|
260 |
},
|
sl@0
|
261 |
{
|
sl@0
|
262 |
0x1b65,
|
sl@0
|
263 |
0x20ac
|
sl@0
|
264 |
}
|
sl@0
|
265 |
};
|
sl@0
|
266 |
#endif //0
|
sl@0
|
267 |
|
sl@0
|
268 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_1[]=
|
sl@0
|
269 |
{
|
sl@0
|
270 |
0x60,
|
sl@0
|
271 |
0x41,
|
sl@0
|
272 |
0x41,
|
sl@0
|
273 |
0x41,
|
sl@0
|
274 |
0x41,
|
sl@0
|
275 |
0x5b,
|
sl@0
|
276 |
0x0e,
|
sl@0
|
277 |
0x1c,
|
sl@0
|
278 |
0x09,
|
sl@0
|
279 |
0x45,
|
sl@0
|
280 |
0x1f,
|
sl@0
|
281 |
0x45,
|
sl@0
|
282 |
0x45,
|
sl@0
|
283 |
0x49,
|
sl@0
|
284 |
0x49,
|
sl@0
|
285 |
0x49,
|
sl@0
|
286 |
0x49
|
sl@0
|
287 |
};
|
sl@0
|
288 |
|
sl@0
|
289 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_2[]=
|
sl@0
|
290 |
{
|
sl@0
|
291 |
0x5d,
|
sl@0
|
292 |
0x4f,
|
sl@0
|
293 |
0x4f,
|
sl@0
|
294 |
0x4f,
|
sl@0
|
295 |
0x4f,
|
sl@0
|
296 |
0x5c
|
sl@0
|
297 |
};
|
sl@0
|
298 |
|
sl@0
|
299 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_3[]=
|
sl@0
|
300 |
{
|
sl@0
|
301 |
0x0b,
|
sl@0
|
302 |
0x55,
|
sl@0
|
303 |
0x55,
|
sl@0
|
304 |
0x55,
|
sl@0
|
305 |
0x5e,
|
sl@0
|
306 |
0x59
|
sl@0
|
307 |
};
|
sl@0
|
308 |
|
sl@0
|
309 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_4[]=
|
sl@0
|
310 |
{
|
sl@0
|
311 |
0x1e,
|
sl@0
|
312 |
0x7f,
|
sl@0
|
313 |
0x61,
|
sl@0
|
314 |
0x61,
|
sl@0
|
315 |
0x61,
|
sl@0
|
316 |
0x7b,
|
sl@0
|
317 |
0x0f,
|
sl@0
|
318 |
0x1d,
|
sl@0
|
319 |
0x09,
|
sl@0
|
320 |
0x04,
|
sl@0
|
321 |
0x05,
|
sl@0
|
322 |
0x65,
|
sl@0
|
323 |
0x65,
|
sl@0
|
324 |
0x07,
|
sl@0
|
325 |
0x69,
|
sl@0
|
326 |
0x69,
|
sl@0
|
327 |
0x69
|
sl@0
|
328 |
};
|
sl@0
|
329 |
|
sl@0
|
330 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_5[]=
|
sl@0
|
331 |
{
|
sl@0
|
332 |
0x7d,
|
sl@0
|
333 |
0x08,
|
sl@0
|
334 |
0x6f,
|
sl@0
|
335 |
0x6f,
|
sl@0
|
336 |
0x6f,
|
sl@0
|
337 |
0x7c
|
sl@0
|
338 |
};
|
sl@0
|
339 |
|
sl@0
|
340 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_6[]=
|
sl@0
|
341 |
{
|
sl@0
|
342 |
0x0c,
|
sl@0
|
343 |
0x06,
|
sl@0
|
344 |
0x75,
|
sl@0
|
345 |
0x75,
|
sl@0
|
346 |
0x7e,
|
sl@0
|
347 |
0x79
|
sl@0
|
348 |
};
|
sl@0
|
349 |
|
sl@0
|
350 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_7[]=
|
sl@0
|
351 |
{
|
sl@0
|
352 |
0x49,
|
sl@0
|
353 |
0x41,
|
sl@0
|
354 |
0x42,
|
sl@0
|
355 |
0x13,
|
sl@0
|
356 |
0x10,
|
sl@0
|
357 |
0x45,
|
sl@0
|
358 |
0x5a,
|
sl@0
|
359 |
0x48,
|
sl@0
|
360 |
0x19,
|
sl@0
|
361 |
0x49,
|
sl@0
|
362 |
0x4b,
|
sl@0
|
363 |
0x14,
|
sl@0
|
364 |
0x4d,
|
sl@0
|
365 |
0x4e,
|
sl@0
|
366 |
0x1a,
|
sl@0
|
367 |
0x4f
|
sl@0
|
368 |
};
|
sl@0
|
369 |
|
sl@0
|
370 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_8[]=
|
sl@0
|
371 |
{
|
sl@0
|
372 |
0x18,
|
sl@0
|
373 |
0x54,
|
sl@0
|
374 |
0x59,
|
sl@0
|
375 |
0x12,
|
sl@0
|
376 |
0x58,
|
sl@0
|
377 |
0x17,
|
sl@0
|
378 |
0x15,
|
sl@0
|
379 |
0x49,
|
sl@0
|
380 |
0x59,
|
sl@0
|
381 |
0x41,
|
sl@0
|
382 |
0x45,
|
sl@0
|
383 |
0x48,
|
sl@0
|
384 |
0x49
|
sl@0
|
385 |
};
|
sl@0
|
386 |
|
sl@0
|
387 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_9[]=
|
sl@0
|
388 |
{
|
sl@0
|
389 |
0x59,
|
sl@0
|
390 |
0x41,
|
sl@0
|
391 |
0x42,
|
sl@0
|
392 |
0x13,
|
sl@0
|
393 |
0x10,
|
sl@0
|
394 |
0x45,
|
sl@0
|
395 |
0x5a,
|
sl@0
|
396 |
0x48,
|
sl@0
|
397 |
0x19,
|
sl@0
|
398 |
0x49,
|
sl@0
|
399 |
0x4b,
|
sl@0
|
400 |
0x14,
|
sl@0
|
401 |
0x4d,
|
sl@0
|
402 |
0x4e,
|
sl@0
|
403 |
0x1a,
|
sl@0
|
404 |
0x4f
|
sl@0
|
405 |
};
|
sl@0
|
406 |
|
sl@0
|
407 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_10[]=
|
sl@0
|
408 |
{
|
sl@0
|
409 |
0x16,
|
sl@0
|
410 |
0x50,
|
sl@0
|
411 |
0x18,
|
sl@0
|
412 |
0x18,
|
sl@0
|
413 |
0x54,
|
sl@0
|
414 |
0x59,
|
sl@0
|
415 |
0x12,
|
sl@0
|
416 |
0x58,
|
sl@0
|
417 |
0x17,
|
sl@0
|
418 |
0x15,
|
sl@0
|
419 |
0x49,
|
sl@0
|
420 |
0x59,
|
sl@0
|
421 |
0x4f,
|
sl@0
|
422 |
0x59,
|
sl@0
|
423 |
0x15
|
sl@0
|
424 |
};
|
sl@0
|
425 |
|
sl@0
|
426 |
LOCAL_D const TUint16 keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_11[]=
|
sl@0
|
427 |
{
|
sl@0
|
428 |
0x42,
|
sl@0
|
429 |
0x19,
|
sl@0
|
430 |
0x59,
|
sl@0
|
431 |
0x59,
|
sl@0
|
432 |
0x59,
|
sl@0
|
433 |
0x12
|
sl@0
|
434 |
};
|
sl@0
|
435 |
|
sl@0
|
436 |
LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry keyedTables16OfIndexedTables16_keyedEntries_unicodeToSms7Bit_1[]=
|
sl@0
|
437 |
{
|
sl@0
|
438 |
{
|
sl@0
|
439 |
0x00bf,
|
sl@0
|
440 |
0x00cf,
|
sl@0
|
441 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_1
|
sl@0
|
442 |
},
|
sl@0
|
443 |
{
|
sl@0
|
444 |
0x00d1,
|
sl@0
|
445 |
0x00d6,
|
sl@0
|
446 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_2
|
sl@0
|
447 |
},
|
sl@0
|
448 |
{
|
sl@0
|
449 |
0x00d8,
|
sl@0
|
450 |
0x00dd,
|
sl@0
|
451 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_3
|
sl@0
|
452 |
},
|
sl@0
|
453 |
{
|
sl@0
|
454 |
0x00df,
|
sl@0
|
455 |
0x00ef,
|
sl@0
|
456 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_4
|
sl@0
|
457 |
},
|
sl@0
|
458 |
{
|
sl@0
|
459 |
0x00f1,
|
sl@0
|
460 |
0x00f6,
|
sl@0
|
461 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_5
|
sl@0
|
462 |
},
|
sl@0
|
463 |
{
|
sl@0
|
464 |
0x00f8,
|
sl@0
|
465 |
0x00fd,
|
sl@0
|
466 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_6
|
sl@0
|
467 |
},
|
sl@0
|
468 |
{
|
sl@0
|
469 |
0x0390,
|
sl@0
|
470 |
0x039f,
|
sl@0
|
471 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_7
|
sl@0
|
472 |
},
|
sl@0
|
473 |
{
|
sl@0
|
474 |
0x03a3,
|
sl@0
|
475 |
0x03af,
|
sl@0
|
476 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_8
|
sl@0
|
477 |
},
|
sl@0
|
478 |
{
|
sl@0
|
479 |
0x03b0,
|
sl@0
|
480 |
0x03bf,
|
sl@0
|
481 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_9
|
sl@0
|
482 |
},
|
sl@0
|
483 |
{
|
sl@0
|
484 |
0x03c0,
|
sl@0
|
485 |
0x03ce,
|
sl@0
|
486 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_10
|
sl@0
|
487 |
},
|
sl@0
|
488 |
{
|
sl@0
|
489 |
0x03d0,
|
sl@0
|
490 |
0x03d5,
|
sl@0
|
491 |
keyedTables16OfIndexedTables16_indexedEntries_unicodeToSms7Bit_11
|
sl@0
|
492 |
}
|
sl@0
|
493 |
};
|
sl@0
|
494 |
|
sl@0
|
495 |
LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry keyedTable1616_unicodeToSms7Bit_1[]=
|
sl@0
|
496 |
{
|
sl@0
|
497 |
{
|
sl@0
|
498 |
0x000a,
|
sl@0
|
499 |
0x0a
|
sl@0
|
500 |
},
|
sl@0
|
501 |
{
|
sl@0
|
502 |
0x000d,
|
sl@0
|
503 |
0x0d
|
sl@0
|
504 |
},
|
sl@0
|
505 |
{
|
sl@0
|
506 |
0x001b,
|
sl@0
|
507 |
0x1b
|
sl@0
|
508 |
},
|
sl@0
|
509 |
{
|
sl@0
|
510 |
0x0020,
|
sl@0
|
511 |
0x20
|
sl@0
|
512 |
},
|
sl@0
|
513 |
{
|
sl@0
|
514 |
0x0021,
|
sl@0
|
515 |
0x21
|
sl@0
|
516 |
},
|
sl@0
|
517 |
{
|
sl@0
|
518 |
0x0022,
|
sl@0
|
519 |
0x22
|
sl@0
|
520 |
},
|
sl@0
|
521 |
{
|
sl@0
|
522 |
0x0023,
|
sl@0
|
523 |
0x23
|
sl@0
|
524 |
},
|
sl@0
|
525 |
{
|
sl@0
|
526 |
0x0024,
|
sl@0
|
527 |
0x02
|
sl@0
|
528 |
},
|
sl@0
|
529 |
{
|
sl@0
|
530 |
0x0040,
|
sl@0
|
531 |
0x00
|
sl@0
|
532 |
},
|
sl@0
|
533 |
{
|
sl@0
|
534 |
0x005f,
|
sl@0
|
535 |
0x11
|
sl@0
|
536 |
},
|
sl@0
|
537 |
{
|
sl@0
|
538 |
0x00a1,
|
sl@0
|
539 |
0x40
|
sl@0
|
540 |
},
|
sl@0
|
541 |
{
|
sl@0
|
542 |
0x00a3,
|
sl@0
|
543 |
0x01
|
sl@0
|
544 |
},
|
sl@0
|
545 |
{
|
sl@0
|
546 |
0x00a4,
|
sl@0
|
547 |
0x24
|
sl@0
|
548 |
},
|
sl@0
|
549 |
{
|
sl@0
|
550 |
0x00a5,
|
sl@0
|
551 |
0x03
|
sl@0
|
552 |
},
|
sl@0
|
553 |
{
|
sl@0
|
554 |
0x00a7,
|
sl@0
|
555 |
0x5f
|
sl@0
|
556 |
},
|
sl@0
|
557 |
{
|
sl@0
|
558 |
0x00ff,
|
sl@0
|
559 |
0x79
|
sl@0
|
560 |
},
|
sl@0
|
561 |
{
|
sl@0
|
562 |
0x0386,
|
sl@0
|
563 |
0x41
|
sl@0
|
564 |
},
|
sl@0
|
565 |
{
|
sl@0
|
566 |
0x0388,
|
sl@0
|
567 |
0x45
|
sl@0
|
568 |
},
|
sl@0
|
569 |
{
|
sl@0
|
570 |
0x0389,
|
sl@0
|
571 |
0x48
|
sl@0
|
572 |
},
|
sl@0
|
573 |
{
|
sl@0
|
574 |
0x038a,
|
sl@0
|
575 |
0x49
|
sl@0
|
576 |
},
|
sl@0
|
577 |
{
|
sl@0
|
578 |
0x038c,
|
sl@0
|
579 |
0x4f
|
sl@0
|
580 |
},
|
sl@0
|
581 |
{
|
sl@0
|
582 |
0x038e,
|
sl@0
|
583 |
0x59
|
sl@0
|
584 |
},
|
sl@0
|
585 |
{
|
sl@0
|
586 |
0x038f,
|
sl@0
|
587 |
0x15
|
sl@0
|
588 |
},
|
sl@0
|
589 |
{
|
sl@0
|
590 |
0x03a0,
|
sl@0
|
591 |
0x16
|
sl@0
|
592 |
},
|
sl@0
|
593 |
{
|
sl@0
|
594 |
0x03a1,
|
sl@0
|
595 |
0x50
|
sl@0
|
596 |
},
|
sl@0
|
597 |
{
|
sl@0
|
598 |
0x2126,
|
sl@0
|
599 |
0x15
|
sl@0
|
600 |
},
|
sl@0
|
601 |
{
|
sl@0
|
602 |
0x220f,
|
sl@0
|
603 |
0x16
|
sl@0
|
604 |
},
|
sl@0
|
605 |
{
|
sl@0
|
606 |
0x2211,
|
sl@0
|
607 |
0x18
|
sl@0
|
608 |
}
|
sl@0
|
609 |
};
|
sl@0
|
610 |
|
sl@0
|
611 |
LOCAL_D const SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry keyedTable1616_unicodeToSms7Bit_2[]=
|
sl@0
|
612 |
{
|
sl@0
|
613 |
{
|
sl@0
|
614 |
0x000c,
|
sl@0
|
615 |
0x1b0a
|
sl@0
|
616 |
},
|
sl@0
|
617 |
{
|
sl@0
|
618 |
0x005b,
|
sl@0
|
619 |
0x1b3c
|
sl@0
|
620 |
},
|
sl@0
|
621 |
{
|
sl@0
|
622 |
0x005c,
|
sl@0
|
623 |
0x1b2f
|
sl@0
|
624 |
},
|
sl@0
|
625 |
{
|
sl@0
|
626 |
0x005d,
|
sl@0
|
627 |
0x1b3e
|
sl@0
|
628 |
},
|
sl@0
|
629 |
{
|
sl@0
|
630 |
0x005e,
|
sl@0
|
631 |
0x1b14
|
sl@0
|
632 |
},
|
sl@0
|
633 |
{
|
sl@0
|
634 |
0x007b,
|
sl@0
|
635 |
0x1b28
|
sl@0
|
636 |
},
|
sl@0
|
637 |
{
|
sl@0
|
638 |
0x007c,
|
sl@0
|
639 |
0x1b40
|
sl@0
|
640 |
},
|
sl@0
|
641 |
{
|
sl@0
|
642 |
0x007d,
|
sl@0
|
643 |
0x1b29
|
sl@0
|
644 |
},
|
sl@0
|
645 |
{
|
sl@0
|
646 |
0x007e,
|
sl@0
|
647 |
0x1b3d
|
sl@0
|
648 |
},
|
sl@0
|
649 |
{
|
sl@0
|
650 |
0x20ac,
|
sl@0
|
651 |
0x1b65
|
sl@0
|
652 |
}
|
sl@0
|
653 |
};
|
sl@0
|
654 |
|
sl@0
|
655 |
LOCAL_D const SCnvConversionData::SVariableByteData::SRange sms7BitVariableByteDataRanges[]=
|
sl@0
|
656 |
{
|
sl@0
|
657 |
{
|
sl@0
|
658 |
0x00,
|
sl@0
|
659 |
0x1a,
|
sl@0
|
660 |
0,
|
sl@0
|
661 |
0
|
sl@0
|
662 |
},
|
sl@0
|
663 |
{
|
sl@0
|
664 |
0x1b,
|
sl@0
|
665 |
0x1b,
|
sl@0
|
666 |
1,
|
sl@0
|
667 |
0
|
sl@0
|
668 |
},
|
sl@0
|
669 |
{
|
sl@0
|
670 |
0x1c,
|
sl@0
|
671 |
0xff,
|
sl@0
|
672 |
0,
|
sl@0
|
673 |
0
|
sl@0
|
674 |
}
|
sl@0
|
675 |
};
|
sl@0
|
676 |
|
sl@0
|
677 |
LOCAL_D const SCnvConversionData::SOneDirectionData::SRange sms7BitToUnicodeDataRanges[]=
|
sl@0
|
678 |
{
|
sl@0
|
679 |
{
|
sl@0
|
680 |
0x25,
|
sl@0
|
681 |
0x3f,
|
sl@0
|
682 |
SCnvConversionData::SOneDirectionData::SRange::EDirect,
|
sl@0
|
683 |
0,
|
sl@0
|
684 |
0,
|
sl@0
|
685 |
{
|
sl@0
|
686 |
0,
|
sl@0
|
687 |
0
|
sl@0
|
688 |
}
|
sl@0
|
689 |
},
|
sl@0
|
690 |
{
|
sl@0
|
691 |
0x41,
|
sl@0
|
692 |
0x5a,
|
sl@0
|
693 |
SCnvConversionData::SOneDirectionData::SRange::EDirect,
|
sl@0
|
694 |
0,
|
sl@0
|
695 |
0,
|
sl@0
|
696 |
{
|
sl@0
|
697 |
0,
|
sl@0
|
698 |
0
|
sl@0
|
699 |
}
|
sl@0
|
700 |
},
|
sl@0
|
701 |
{
|
sl@0
|
702 |
0x61,
|
sl@0
|
703 |
0x7a,
|
sl@0
|
704 |
SCnvConversionData::SOneDirectionData::SRange::EDirect,
|
sl@0
|
705 |
0,
|
sl@0
|
706 |
0,
|
sl@0
|
707 |
{
|
sl@0
|
708 |
0,
|
sl@0
|
709 |
0
|
sl@0
|
710 |
}
|
sl@0
|
711 |
},
|
sl@0
|
712 |
{
|
sl@0
|
713 |
0x40,
|
sl@0
|
714 |
0x40,
|
sl@0
|
715 |
SCnvConversionData::SOneDirectionData::SRange::EOffset,
|
sl@0
|
716 |
0,
|
sl@0
|
717 |
0,
|
sl@0
|
718 |
{
|
sl@0
|
719 |
STATIC_CAST(TUint, 97),
|
sl@0
|
720 |
0
|
sl@0
|
721 |
}
|
sl@0
|
722 |
},
|
sl@0
|
723 |
{
|
sl@0
|
724 |
0x00,
|
sl@0
|
725 |
0x7f,
|
sl@0
|
726 |
SCnvConversionData::SOneDirectionData::SRange::EKeyedTable16OfIndexedTables16,
|
sl@0
|
727 |
0,
|
sl@0
|
728 |
0,
|
sl@0
|
729 |
{
|
sl@0
|
730 |
UData_SKeyedTable16OfIndexedTables16(keyedTables16OfIndexedTables16_keyedEntries_sms7BitToUnicode_1)
|
sl@0
|
731 |
}
|
sl@0
|
732 |
},
|
sl@0
|
733 |
#if 0
|
sl@0
|
734 |
{
|
sl@0
|
735 |
0x1b0a,
|
sl@0
|
736 |
0x1b65,
|
sl@0
|
737 |
SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
|
sl@0
|
738 |
0,
|
sl@0
|
739 |
0,
|
sl@0
|
740 |
{
|
sl@0
|
741 |
UData_KeyedTable(keyedTable1616_sms7BitToUnicode_1)
|
sl@0
|
742 |
}
|
sl@0
|
743 |
}
|
sl@0
|
744 |
#else
|
sl@0
|
745 |
{
|
sl@0
|
746 |
0x1b41,
|
sl@0
|
747 |
0x1b5a,
|
sl@0
|
748 |
SCnvConversionData::SOneDirectionData::SRange::EOffset,
|
sl@0
|
749 |
0,
|
sl@0
|
750 |
0,
|
sl@0
|
751 |
{
|
sl@0
|
752 |
(TUint)-0x1b00,
|
sl@0
|
753 |
0
|
sl@0
|
754 |
}
|
sl@0
|
755 |
},
|
sl@0
|
756 |
{
|
sl@0
|
757 |
0x1b66,
|
sl@0
|
758 |
0x1b7a,
|
sl@0
|
759 |
SCnvConversionData::SOneDirectionData::SRange::EOffset,
|
sl@0
|
760 |
0,
|
sl@0
|
761 |
0,
|
sl@0
|
762 |
{
|
sl@0
|
763 |
(TUint)-0x1b00,
|
sl@0
|
764 |
0
|
sl@0
|
765 |
}
|
sl@0
|
766 |
},
|
sl@0
|
767 |
{
|
sl@0
|
768 |
0x1b00,
|
sl@0
|
769 |
0x1b7f,
|
sl@0
|
770 |
SCnvConversionData::SOneDirectionData::SRange::EKeyedTable16OfIndexedTables16,
|
sl@0
|
771 |
0,
|
sl@0
|
772 |
0,
|
sl@0
|
773 |
{
|
sl@0
|
774 |
UData_SKeyedTable16OfIndexedTables16(keyedTables16OfIndexedTables16_keyedEntries_sms7BitToUnicode_2)
|
sl@0
|
775 |
}
|
sl@0
|
776 |
}
|
sl@0
|
777 |
#endif
|
sl@0
|
778 |
};
|
sl@0
|
779 |
|
sl@0
|
780 |
LOCAL_D const SCnvConversionData::SOneDirectionData::SRange unicodeToSms7BitDataRanges[]=
|
sl@0
|
781 |
{
|
sl@0
|
782 |
{
|
sl@0
|
783 |
0x0025,
|
sl@0
|
784 |
0x003f,
|
sl@0
|
785 |
SCnvConversionData::SOneDirectionData::SRange::EDirect,
|
sl@0
|
786 |
1,
|
sl@0
|
787 |
0,
|
sl@0
|
788 |
{
|
sl@0
|
789 |
0,
|
sl@0
|
790 |
0
|
sl@0
|
791 |
}
|
sl@0
|
792 |
},
|
sl@0
|
793 |
{
|
sl@0
|
794 |
0x0041,
|
sl@0
|
795 |
0x005a,
|
sl@0
|
796 |
SCnvConversionData::SOneDirectionData::SRange::EDirect,
|
sl@0
|
797 |
1,
|
sl@0
|
798 |
0,
|
sl@0
|
799 |
{
|
sl@0
|
800 |
0,
|
sl@0
|
801 |
0
|
sl@0
|
802 |
}
|
sl@0
|
803 |
},
|
sl@0
|
804 |
{
|
sl@0
|
805 |
0x0061,
|
sl@0
|
806 |
0x007a,
|
sl@0
|
807 |
SCnvConversionData::SOneDirectionData::SRange::EDirect,
|
sl@0
|
808 |
1,
|
sl@0
|
809 |
0,
|
sl@0
|
810 |
{
|
sl@0
|
811 |
0,
|
sl@0
|
812 |
0
|
sl@0
|
813 |
}
|
sl@0
|
814 |
},
|
sl@0
|
815 |
{
|
sl@0
|
816 |
0x00bf,
|
sl@0
|
817 |
0x03d5,
|
sl@0
|
818 |
SCnvConversionData::SOneDirectionData::SRange::EKeyedTable16OfIndexedTables16,
|
sl@0
|
819 |
1,
|
sl@0
|
820 |
0,
|
sl@0
|
821 |
{
|
sl@0
|
822 |
UData_SKeyedTable16OfIndexedTables16(keyedTables16OfIndexedTables16_keyedEntries_unicodeToSms7Bit_1)
|
sl@0
|
823 |
}
|
sl@0
|
824 |
},
|
sl@0
|
825 |
{
|
sl@0
|
826 |
0x000a,
|
sl@0
|
827 |
0x2211,
|
sl@0
|
828 |
SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
|
sl@0
|
829 |
1,
|
sl@0
|
830 |
0,
|
sl@0
|
831 |
{
|
sl@0
|
832 |
UData_SKeyedTable1616(keyedTable1616_unicodeToSms7Bit_1)
|
sl@0
|
833 |
}
|
sl@0
|
834 |
},
|
sl@0
|
835 |
{
|
sl@0
|
836 |
0x000c,
|
sl@0
|
837 |
0x20ac,
|
sl@0
|
838 |
SCnvConversionData::SOneDirectionData::SRange::EKeyedTable1616,
|
sl@0
|
839 |
2,
|
sl@0
|
840 |
0,
|
sl@0
|
841 |
{
|
sl@0
|
842 |
UData_SKeyedTable1616(keyedTable1616_unicodeToSms7Bit_2)
|
sl@0
|
843 |
}
|
sl@0
|
844 |
}
|
sl@0
|
845 |
};
|
sl@0
|
846 |
|
sl@0
|
847 |
GLREF_D const SCnvConversionData sms7BitConversionData=
|
sl@0
|
848 |
{
|
sl@0
|
849 |
SCnvConversionData::EFixedBigEndian,
|
sl@0
|
850 |
{
|
sl@0
|
851 |
ARRAY_LENGTH(sms7BitVariableByteDataRanges),
|
sl@0
|
852 |
sms7BitVariableByteDataRanges
|
sl@0
|
853 |
},
|
sl@0
|
854 |
{
|
sl@0
|
855 |
ARRAY_LENGTH(sms7BitToUnicodeDataRanges),
|
sl@0
|
856 |
sms7BitToUnicodeDataRanges
|
sl@0
|
857 |
},
|
sl@0
|
858 |
{
|
sl@0
|
859 |
ARRAY_LENGTH(unicodeToSms7BitDataRanges),
|
sl@0
|
860 |
unicodeToSms7BitDataRanges
|
sl@0
|
861 |
},
|
sl@0
|
862 |
NULL,
|
sl@0
|
863 |
NULL
|
sl@0
|
864 |
};
|
sl@0
|
865 |
|
sl@0
|
866 |
GLREF_C void IsCharacterSetSMS7Bit(TInt& aConfidenceLevel, const TDesC8& aSample)
|
sl@0
|
867 |
{
|
sl@0
|
868 |
_LIT8(KHz1Esc,"\x7e\x7e");
|
sl@0
|
869 |
_LIT8(KHz2Esc,"\x7e\x7b");
|
sl@0
|
870 |
_LIT8(KHz3Esc,"\x7e\x7d");
|
sl@0
|
871 |
_LIT8(KLit8EscapeSequenceForJisRoman, "\x1b\x28\x4a");
|
sl@0
|
872 |
_LIT8(KLit8EscapeSequenceForAscii, "\x1b\x28\x42");
|
sl@0
|
873 |
// _LIT8(KLit8EscapeSequenceForHalfWidthKatakana, "\x1b\x28\x49");
|
sl@0
|
874 |
_LIT8(KLit8EscapeSequenceForJisC6226_1978, "\x1b\x24\x40");
|
sl@0
|
875 |
_LIT8(KLit8EscapeSequenceForJisX0208_1983, "\x1b\x24\x42");
|
sl@0
|
876 |
_LIT8(KLit8EscapeSequenceForJisX0208_199x, "\x1b\x26\x40\x1b\x24\x42");
|
sl@0
|
877 |
_LIT8(KLit8EscapeSequenceForJisX0212_1990, "\x1b\x24\x28\x44");
|
sl@0
|
878 |
|
sl@0
|
879 |
TInt hz1Result=0;
|
sl@0
|
880 |
TInt hz2Result=0;
|
sl@0
|
881 |
TInt hz3Result=0;
|
sl@0
|
882 |
TInt JisRomanResult = 0;
|
sl@0
|
883 |
TInt AsciiResult = 0;
|
sl@0
|
884 |
TInt JisCResult = 0;
|
sl@0
|
885 |
TInt JisX0208Result = 0;
|
sl@0
|
886 |
TInt JisX0212Result = 0;
|
sl@0
|
887 |
TInt JisX0208XResult = 0;
|
sl@0
|
888 |
TInt currency = 0;
|
sl@0
|
889 |
TInt email = 0;
|
sl@0
|
890 |
|
sl@0
|
891 |
TInt sampleLength = aSample.Length();
|
sl@0
|
892 |
aConfidenceLevel =70;
|
sl@0
|
893 |
if (sampleLength == 0)
|
sl@0
|
894 |
return;
|
sl@0
|
895 |
|
sl@0
|
896 |
TInt HzEscSequences = 0;
|
sl@0
|
897 |
TInt JISEscSequences = 0;
|
sl@0
|
898 |
|
sl@0
|
899 |
for (TInt i = 0; i < sampleLength; ++i)
|
sl@0
|
900 |
{
|
sl@0
|
901 |
|
sl@0
|
902 |
if (i > hz1Result)
|
sl@0
|
903 |
{
|
sl@0
|
904 |
hz1Result=(aSample.Right(sampleLength-i)).Find(KHz1Esc);
|
sl@0
|
905 |
if (hz1Result!=KErrNotFound) //aConfidenceLevel-=2;
|
sl@0
|
906 |
HzEscSequences += 5;
|
sl@0
|
907 |
}
|
sl@0
|
908 |
|
sl@0
|
909 |
if (i > hz2Result)
|
sl@0
|
910 |
{
|
sl@0
|
911 |
hz2Result=(aSample.Right(sampleLength-i)).Find(KHz2Esc);
|
sl@0
|
912 |
if (hz2Result!=KErrNotFound) //aConfidenceLevel-=2;
|
sl@0
|
913 |
HzEscSequences += 5;
|
sl@0
|
914 |
}
|
sl@0
|
915 |
|
sl@0
|
916 |
if (i > hz3Result)
|
sl@0
|
917 |
{
|
sl@0
|
918 |
hz3Result=(aSample.Right(sampleLength-i)).Find(KHz3Esc);
|
sl@0
|
919 |
if (hz3Result!=KErrNotFound) //aConfidenceLevel-=2;
|
sl@0
|
920 |
HzEscSequences += 5;
|
sl@0
|
921 |
}
|
sl@0
|
922 |
|
sl@0
|
923 |
if (i > JisRomanResult)
|
sl@0
|
924 |
{
|
sl@0
|
925 |
JisRomanResult = (aSample.Right(sampleLength-i)).Find(KLit8EscapeSequenceForJisRoman);
|
sl@0
|
926 |
if (JisRomanResult!=KErrNotFound)
|
sl@0
|
927 |
JISEscSequences +=10;
|
sl@0
|
928 |
}
|
sl@0
|
929 |
|
sl@0
|
930 |
if (i > AsciiResult)
|
sl@0
|
931 |
{
|
sl@0
|
932 |
AsciiResult = (aSample.Right(sampleLength-i)).Find(KLit8EscapeSequenceForAscii);
|
sl@0
|
933 |
if (AsciiResult!=KErrNotFound)
|
sl@0
|
934 |
JISEscSequences +=10;
|
sl@0
|
935 |
}
|
sl@0
|
936 |
|
sl@0
|
937 |
if (i > JisCResult)
|
sl@0
|
938 |
{
|
sl@0
|
939 |
JisCResult = (aSample.Right(sampleLength-i)).Find(KLit8EscapeSequenceForJisC6226_1978);
|
sl@0
|
940 |
if (JisCResult!=KErrNotFound)
|
sl@0
|
941 |
JISEscSequences +=5;
|
sl@0
|
942 |
}
|
sl@0
|
943 |
|
sl@0
|
944 |
if (i > JisX0208Result)
|
sl@0
|
945 |
{
|
sl@0
|
946 |
JisX0208Result = (aSample.Right(sampleLength-i)).Find(KLit8EscapeSequenceForJisX0208_1983);
|
sl@0
|
947 |
if (JisX0208Result!=KErrNotFound)
|
sl@0
|
948 |
JISEscSequences +=5;
|
sl@0
|
949 |
}
|
sl@0
|
950 |
|
sl@0
|
951 |
if (i > JisX0212Result)
|
sl@0
|
952 |
{
|
sl@0
|
953 |
JisX0212Result = (aSample.Right(sampleLength-i)).Find(KLit8EscapeSequenceForJisX0212_1990);
|
sl@0
|
954 |
if (JisX0212Result!=KErrNotFound)
|
sl@0
|
955 |
JISEscSequences +=5;
|
sl@0
|
956 |
}
|
sl@0
|
957 |
|
sl@0
|
958 |
if (i > JisX0208XResult)
|
sl@0
|
959 |
{
|
sl@0
|
960 |
JisX0208XResult = (aSample.Right(sampleLength-i)).Find(KLit8EscapeSequenceForJisX0208_199x);
|
sl@0
|
961 |
if (JisX0208XResult!=KErrNotFound)
|
sl@0
|
962 |
JISEscSequences +=5;
|
sl@0
|
963 |
}
|
sl@0
|
964 |
|
sl@0
|
965 |
if ((aSample[i]&0x80)!=0x00)
|
sl@0
|
966 |
{
|
sl@0
|
967 |
aConfidenceLevel = 0;
|
sl@0
|
968 |
break;
|
sl@0
|
969 |
}
|
sl@0
|
970 |
else
|
sl@0
|
971 |
{
|
sl@0
|
972 |
TInt increment1 = i+1;
|
sl@0
|
973 |
if (aSample[i] == 0x1b)
|
sl@0
|
974 |
{
|
sl@0
|
975 |
static const TInt defaultExtensionTable[10] =
|
sl@0
|
976 |
{0x0a, 0x14, 0x1b, 0x29, 0x2f, 0x3c, 0x3d, 0x3e, 0x40, 0x65};
|
sl@0
|
977 |
if (increment1 >= sampleLength)
|
sl@0
|
978 |
break;
|
sl@0
|
979 |
for (TInt j =0; j < 10; j++)
|
sl@0
|
980 |
{
|
sl@0
|
981 |
if (aSample[increment1] == defaultExtensionTable[j])
|
sl@0
|
982 |
{
|
sl@0
|
983 |
aConfidenceLevel+=5;
|
sl@0
|
984 |
break;
|
sl@0
|
985 |
}
|
sl@0
|
986 |
}
|
sl@0
|
987 |
}
|
sl@0
|
988 |
else if (currency<100 && (aSample[i]==0x01 || aSample[i]==0x02 || aSample[i]==0x03))
|
sl@0
|
989 |
{
|
sl@0
|
990 |
if (increment1 >= sampleLength)
|
sl@0
|
991 |
break;
|
sl@0
|
992 |
if ((aSample[increment1] >= 0x30) && (aSample[increment1] <= 0x39))
|
sl@0
|
993 |
{
|
sl@0
|
994 |
currency ? currency *= 3 : currency = 3;
|
sl@0
|
995 |
}
|
sl@0
|
996 |
}
|
sl@0
|
997 |
else if (email<100 && aSample[i]==0x00) // @
|
sl@0
|
998 |
{
|
sl@0
|
999 |
TBool valid = ETrue;
|
sl@0
|
1000 |
TInt pos = i-1;
|
sl@0
|
1001 |
while(valid && pos>=0) // check before @
|
sl@0
|
1002 |
{
|
sl@0
|
1003 |
TInt8 act = aSample[pos];
|
sl@0
|
1004 |
if(act==' ' || act=='\n' || act=='\t')
|
sl@0
|
1005 |
break;
|
sl@0
|
1006 |
if( !( ( act >= 'a' && act <= 'z' ) ||
|
sl@0
|
1007 |
( act >= 'A' && act <= 'Z' ) ||
|
sl@0
|
1008 |
( act >= '0' && act <= '9' ) ||
|
sl@0
|
1009 |
act == '.' ||
|
sl@0
|
1010 |
act == '-' ||
|
sl@0
|
1011 |
act == /*'_'*/0x11 ) )
|
sl@0
|
1012 |
{
|
sl@0
|
1013 |
valid = EFalse;
|
sl@0
|
1014 |
}
|
sl@0
|
1015 |
pos--;
|
sl@0
|
1016 |
}
|
sl@0
|
1017 |
|
sl@0
|
1018 |
TInt space = aSample.Mid(i+1).Find((const unsigned char*)" ",1);
|
sl@0
|
1019 |
TInt lf = aSample.Mid(i+1).Find((const unsigned char*)"\n",1);
|
sl@0
|
1020 |
TInt end = aSample.Length() - (i+1);
|
sl@0
|
1021 |
if(space != KErrNotFound)
|
sl@0
|
1022 |
{
|
sl@0
|
1023 |
end = space;
|
sl@0
|
1024 |
}
|
sl@0
|
1025 |
else if(lf != KErrNotFound)
|
sl@0
|
1026 |
{
|
sl@0
|
1027 |
end = lf;
|
sl@0
|
1028 |
}
|
sl@0
|
1029 |
TPtrC8 string = aSample.Mid(i+1,end);
|
sl@0
|
1030 |
TInt commat = string.Find((const unsigned char*)"\x0",1);
|
sl@0
|
1031 |
TInt period = string.Find((const unsigned char*)".",1);
|
sl@0
|
1032 |
if(commat!=KErrNotFound || period==KErrNotFound)
|
sl@0
|
1033 |
{
|
sl@0
|
1034 |
valid = EFalse;
|
sl@0
|
1035 |
}
|
sl@0
|
1036 |
if(valid)
|
sl@0
|
1037 |
{
|
sl@0
|
1038 |
email ? email *= 5 : email = 5;
|
sl@0
|
1039 |
}
|
sl@0
|
1040 |
else
|
sl@0
|
1041 |
{
|
sl@0
|
1042 |
aConfidenceLevel += 5; // not valid address but still valid '@'
|
sl@0
|
1043 |
}
|
sl@0
|
1044 |
}
|
sl@0
|
1045 |
//next test the occurance of values 00-2f (except 0a & 0d) next to another character
|
sl@0
|
1046 |
// These are the ASCII control codes and therefore low chances of these values occuring
|
sl@0
|
1047 |
// next to the ASCII value
|
sl@0
|
1048 |
else if (aSample[i] < 0x20 && aSample[i] != '\r' && aSample[i] != '\n')
|
sl@0
|
1049 |
{
|
sl@0
|
1050 |
if (increment1 >= sampleLength)
|
sl@0
|
1051 |
break;
|
sl@0
|
1052 |
if (((aSample[increment1] >= 0x20) && (aSample[increment1] <= 0x5a)) ||
|
sl@0
|
1053 |
((aSample[increment1] >= 0x61) && (aSample[increment1] <= 0x7a)))
|
sl@0
|
1054 |
{
|
sl@0
|
1055 |
aConfidenceLevel+=2;
|
sl@0
|
1056 |
}
|
sl@0
|
1057 |
}
|
sl@0
|
1058 |
// other possible tests to include... Greek matching...
|
sl@0
|
1059 |
}
|
sl@0
|
1060 |
} // for loop
|
sl@0
|
1061 |
aConfidenceLevel += currency + email;
|
sl@0
|
1062 |
aConfidenceLevel = aConfidenceLevel - ((HzEscSequences*100)/sampleLength);
|
sl@0
|
1063 |
aConfidenceLevel = aConfidenceLevel - ((JISEscSequences*100)/sampleLength);
|
sl@0
|
1064 |
aConfidenceLevel =(aConfidenceLevel >0)? ((aConfidenceLevel > 100)? 100: aConfidenceLevel): 0;
|
sl@0
|
1065 |
}
|
sl@0
|
1066 |
|