-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvcode.c
More file actions
executable file
·2569 lines (2218 loc) · 99.1 KB
/
convcode.c
File metadata and controls
executable file
·2569 lines (2218 loc) · 99.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Project:
File Name: ConvCode.c
Author: ygy
Date:
C Compiler:
Purpose:
Copyright (C) 2009 Inventec Electronics (Nanjing) Co., Ltd.
All rights reserved.
*/
#include "convcode.h"
#include "string.h"
#ifndef _ASSERT
#define _ASSERT(x) //while(1);
#endif
#ifdef WIN32
#pragma warning(error: 4001) /**< nonstandard extension 'single line comment' was used (disallow "//" C++ comments) */
#pragma warning(error: 4002) /**< too many actual parameters for macro 'identifier' */
#pragma warning(error: 4003) /**< not enough actual parameters for macro 'identifier' */
#pragma warning(error: 4004) /**< incorrect construction after 'defined' */
#pragma warning(error: 4005) /**< 'identifier' : macro redefinition */
#pragma warning(error: 4006) /**< #undef expected an identifier */
#pragma warning(error: 4009) /**< string too big; trailing characters truncated */
#pragma warning(error: 4013) /**< 'function' undefined; assuming extern returning int */
#pragma warning(error: 4015) /**< 'identifier' : type of bit field must be integral */
#pragma warning(error: 4016) /**< 'function' : no function return type; using int as default */
#pragma warning(error: 4018) /**< 'expression' : signed/unsigned mismatch */
#pragma warning(error: 4020) /**< 'function' : too many actual parameters */
#pragma warning(error: 4021) /**< 'function' : too few actual parameters */
#pragma warning(error: 4022) /**< 'function' : pointer mismatch for actual parameter 'number' */
#pragma warning(error: 4023) /**< 'symbol' : based pointer passed to unprototyped function : parameter number */
#pragma warning(error: 4024) /**< 'function' : different types for formal and actual parameter 'number' */
#pragma warning(error: 4025) /**< 'number' : based pointer passed to function with variable arguments: parameter number */
#pragma warning(error: 4026) /**< function declared with formal parameter list */
#pragma warning(error: 4027) /**< function declared without formal parameter list */
#pragma warning(error: 4028) /**< formal parameter 'number' different from declaration */
#pragma warning(error: 4029) /**< declared formal parameter list different from definition */
#pragma warning(error: 4030) /**< first formal parameter list longer than the second list */
#pragma warning(error: 4031) /**< second formal parameter list longer than the first list */
#pragma warning(error: 4033) /**< 'function' must return a value */
#pragma warning(error: 4035) /**< 'function' : no return value */
#pragma warning(error: 4036) /**< unnamed 'type' as actual parameter */
#pragma warning(error: 4045) /**< 'identifier' : array bounds overflow */
#pragma warning(error: 4047) /**< 'identifier1' : 'operator' : different levels of indirection from 'identifier2' */
#pragma warning(error: 4049) /**< compiler limit : terminating line number emission */
#pragma warning(error: 4051) /**< type conversion; possible loss of data */
#pragma warning(error: 4053) /**< one void operand for '?:' */
#pragma warning(error: 4054) /**< 'conversion' : from function pointer 'type1' to data pointer 'type2' */
#pragma warning(error: 4057) /**< 'operator' : 'identifier1' indirection to slightly different base types from 'identifier2' */
#pragma warning(error: 4059) /**< pascal string too big, length byte is length % 256 */
#pragma warning(error: 4061) /**< enumerate 'identifier' in switch of enum 'identifier' is not explicitly handled by a case label */
#pragma warning(error: 4063) /**< case 'identifier' is not a valid value for switch of enum 'identifier' */
#pragma warning(error: 4064) /**< switch of incomplete enum 'identifier' */
#pragma warning(error: 4071) /**< 'function' : no function prototype given */
#pragma warning(error: 4072) /**< 'function' : no function prototype on 'convention' function */
#pragma warning(error: 4078) /**< case constant 'value' too big for the type of the switch expression */
#pragma warning(error: 4081) /**< expected 'token1'; found 'token2' */
#pragma warning(error: 4087) /**< 'function' : declared with 'void' parameter list */
#pragma warning(error: 4088) /**< 'function' : pointer mismatch in actual parameter 'number', formal parameter 'number' */
#pragma warning(error: 4089) /**< 'function' : different types in actual parameter 'number', formal parameter 'number' */
#pragma warning(error: 4098) /**< 'function' : void function returning a value */
#pragma warning(error: 4113) /**< 'identifier1' differs in parameter lists from 'identifier2' */
#pragma warning(error: 4129) /**< 'character' : unrecognized character escape sequence */
#pragma warning(error: 4133) /**< 'type' : incompatible types - from 'type1' to 'type2' */
#pragma warning(error: 4150) /**< deletion of pointer to incomplete type 'type'; no destructor called */
#pragma warning(error: 4172) /**< returning address of local variable or temporary */
#pragma warning(error: 4221) /**< nonstandard extension used : 'identifier' : cannot be initialized using address of automatic variable */
#pragma warning(error: 4223) /**< nonstandard extension used : non-lvalue array converted to pointer */
#pragma warning(error: 4224) /**< nonstandard extension used : formal parameter 'identifier' was previously defined as a type */
#pragma warning(error: 4390) /**< ';' : empty controlled statement found; is this what was intended?" */
#pragma warning(error: 4508) /**< 'function' : function should return a value; void return type assumed */
#pragma warning(error: 4541) /**< 'identifier' used on polymorphic type 'type' with /GR-; unpredictable behavior may result */
#pragma warning(error: 4551) /**< function call missing argument list */
#pragma warning(error: 4553) /**< 'operator' : operator has no effect; did you intend 'operator'? */
#pragma warning(error: 4700) /**< local variable 'name' used without having been initialized */
#pragma warning(error: 4706) /**< assignment within conditional expression */
#pragma warning(error: 4715) /**< 'function' : not all control paths return a value */
#pragma warning(error: 4761) /**< integral size mismatch in argument : conversion supplied */
#endif /* WIN32 */
#define USE_CP1252_TABLE
//#define USE_CP858_TABLE
//#define USE_CP437_TABLE
//#define USE_ISO_8859_15_TABLE
///////////////////////////
/* The 0's in this table correspond exactly with the Greek character table definition GsmGclToUcs2 */
static const _WORD GsmToUcs2[GSM_CHARACTER_SET_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x40, 0xa3, 0x24, 0xa5, 0xe8, 0xe9, 0xf9, 0xec,
/*0x07*/ 0xf2, 0xc7, 0x0a, 0xd8, 0xf8, 0x0d, 0xc5, 0xe5,
/*0x10*/ 0, 0x5f, 0, 0, 0, 0, 0, 0,
/*0x18*/ 0, 0, 0, 0x20, 0xc6, 0xe6, 0xdf, 0xc9,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0xA4, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x37*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0xa1, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0xc4, 0xd6, 0xd1, 0xdc, 0xa7,
/*0x60*/ 0xbf, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0xe4, 0xf6, 0xf1, 0xfc, 0xe0
};
/* array of UCS2 Greek character values correspondng to relevant GSM value - 0x10 - GSM value for Delta.
The 0 at the second aray position corresponds to GSM _. */
static const _WORD GsmGclToUcs2[] =
{/* Delta -- Phi Gamma Lamda Omega */
0x0394, 0x0000, 0x03A6, 0x0393, 0x039b, 0x03a9,
/* Pi Psi Sigma Theta Xi */
0x03a0, 0x03a8, 0x03a3, 0x0398, 0x039e
};
/* GSM character and extended character values obtained from specification 23.038.
UCS2 (unicode) values obtained from unicode specification version 3(www.unicode.org). */
static const _WORD GsmToUcs2Ex[GSM_CHARACTER_SET_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x40, 0xA3, 0x24, 0xA5, 0xE8, 0xE9, 0xF9, 0xEC,
/*0x08*/ 0xF2, 0xC7, 0x0a, 0xD8, 0xF8, 0x0d, 0xC5, 0xE5,
/* Delta Phi Gamma Lamda Omega Pi Psi */
/*0x10*/ 0x394, 0x5F, 0x3A6, 0x393, 0x39B, 0x3A9, 0x3A0, 0x3A8,
/* Sigma Theta Xi */
/*0x18*/ 0x3A3, 0x398, 0x39E, 0x20, 0xC6, 0xE6, 0xDF, 0xC9,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0xA4, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
/*0x40*/ 0xA1, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5A, 0xC4, 0xD6, 0xD1, 0xDC, 0xA7,
/*0x60*/ 0xBF, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7A, 0xE4, 0xF6, 0xF1, 0xFC, 0xE0
};
/* Extended Alphabet Table for Euro Character 0x20AC
Added SPACE 0x20 in table, at postion 27 (0x1B)
so if we recieve to extended characters together we return a SPACE */
static const _WORD ExtendedGsmToUcs2[GSM_CHARACTER_SET_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x08*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x10*/ 0, 0, 0, 0, 0x5E, 0, 0, 0, /* . . . . ^ . . . */
/*0x18*/ 0, 0, 0, 0x20, 0, 0, 0, 0, /* . . . . . . . */
/*0x20*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x28*/ 0x7B, 0x7D, 0, 0, 0, 0, 0, 0x5C, /* { } . . . . . \ */
/*0x30*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x38*/ 0, 0, 0, 0, 0x5B, 0x7E, 0x5D, 0, /* . . . . [ ~ ] . */
/*0x40*/ 0x7C, 0, 0, 0, 0, 0, 0, 0, /* | . . . . . . . */
/*0x48*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x50*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x58*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x60*/ 0, 0, 0, 0, 0, 0x20AC, 0, 0, /* . . . . . . . */
/*0x68*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x70*/ 0, 0, 0, 0, 0, 0, 0, 0, /* . . . . . . . . */
/*0x78*/ 0, 0, 0, 0, 0, 0, 0, 0 /* . . . . . . . . */
};
/*
Convert a GSM or EGSM character to a ucs2 character.
further reworking to protect the code after devAsserts so that a space is returned
if the first GSM character value is out of range or a space is returned if the first character is
ESC and the second character is out of range.
Parameters:
gsm1 - first character of EGSM pair (GSM value if not EGSM, ESC if EGSM)
gsm2 - second character of EGSM pair (should be NON_GSM if not EGSM)
ucs2 - pointer to the resultant ucs2 value.
returns:
GSM7BIT - if normal GSM character
NON_GSM7BIT - if cannot be represented in GSM or EGSM
EXTENDED_GSM7BIT - if EGSM character (pair)
*/
GsmCharType mapEGsmToUcs2(_BYTE gsm1, _BYTE gsm2, _WORD *ucs2_p)
{
GsmCharType retVal = NON_GSM7BIT;
_ASSERT(gsm1 < GSM_CHARACTER_SET_SIZE);
/* If gsm1 is a valid GSM character then try to map it otherwise just return a SPACE */
if (gsm1 < GSM_CHARACTER_SET_SIZE)
{
if (gsm1 == EXTENDED_ALPHABET_TABLE) // 0x1B
{
/* Second Character NON_GSM - return Space */
if(gsm2 == NON_GSM)
{
*ucs2_p = SPACE;
retVal = GSM7BIT;
}
else
{
_ASSERT(gsm2 < GSM_CHARACTER_SET_SIZE);
/* If gsm2 is a valid GSM character then try to map it otherwise just return a SPACE */
if (gsm2 < GSM_CHARACTER_SET_SIZE)
{
*ucs2_p = ExtendedGsmToUcs2[gsm2];
/* if no valid character found after escape character 0x1B,
Need to display a space, and the character following the escape character
is displayed using the default GsmToUcs2 Table */
if(*ucs2_p == 0)
{
*ucs2_p = SPACE;
retVal = GSM7BIT;
}
else
{
retVal = EXTENDED_GSM7BIT;
}
}
else
{
/* gsm2 out of range - so just return a GSM7BIT space */
*ucs2_p = SPACE;
retVal = GSM7BIT;
}
}
}
else
{
#if 1
*ucs2_p = GsmToUcs2[gsm1];
/* if 0 returned then it must be a Greek character, as the GSMToUcs2 table is full apart
from the Greek characters.
gsm1 must be in range as we've already checked that it's < GSM_CHARACTER_SET_SIZE. */
if(*ucs2_p == 0)
{
*ucs2_p = GsmGclToUcs2[gsm1 - GSM_GREEK_CAPITAL_LETTER_DELTA];
}
#else
*ucs2_p = GsmToUcs2Ex[gsm1];
#endif
retVal = GSM7BIT;
}
}
else
{
/* gsm1 out of range - so just return a GSM7BIT space */
*ucs2_p = SPACE;
retVal = GSM7BIT;
}
return retVal;
}
/*
Converts an array of bytes, each of which should be a valid GSM character (range 0 to 0x7F) to a
string of UCS2 characters.
Stops when a conversion fails and returns the number of successful conversions performed.
This function converts an array of bytes into UCS2. The bytes are ordered MSB,LSB,MSB,LSB.
*/
GsmCharType ConvEGsmToUcs2(const _BYTE *gsmStr_p, _WORD gsmDataLength, _WORD *ucs2Str_p, _WORD *ucs2Length_p)
{
GsmCharType retVal = GSM7BIT;
GsmCharType charType = NON_GSM7BIT;
_WORD ucs2Byte = 0;
_WORD currentGsm = 0;
_WORD currentUcs2 = 0;
/* Loop through gsm data buffer upto last two characters */
for(currentGsm = 0; currentGsm < gsmDataLength - 2; currentGsm++)
{
/* use mapEGsmToUcs2 to transform Gsm Characters into ucs2 character */
charType = mapEGsmToUcs2(gsmStr_p[currentGsm], gsmStr_p[currentGsm+1], &ucs2Byte);
if(charType == EXTENDED_GSM7BIT || charType == GSM7BIT)
{
/* store ucs2 Byte in Ucs2 String */
ucs2Str_p[currentUcs2] = ucs2Byte;
/*Increment Ucs2 String index */
currentUcs2++;
/* Extended Character Found */
if(charType == EXTENDED_GSM7BIT)
{
/* Increment currentGsm by 1 to move past Extended Character */
currentGsm++;
/* Set Return type */
retVal = EXTENDED_GSM7BIT;
}
}
else
{
retVal = NON_GSM7BIT;
break;
}
}
/* Check Valid GSM String */
if((retVal == GSM7BIT) || ( retVal == EXTENDED_GSM7BIT) )
{
/* Check for two characters in Gsm Buffer */
if(currentGsm < gsmDataLength - 1)
{
/* Use mapEGsmToUcs2 to convert last two characters in gsm String to Ucs2 */
charType = mapEGsmToUcs2(gsmStr_p[currentGsm], gsmStr_p[currentGsm+1], &ucs2Byte);
/* If last two characters were an extended Character */
if(charType == EXTENDED_GSM7BIT)
{
/* store ucs2 Byte in Ucs2 String */
ucs2Str_p[currentUcs2] = ucs2Byte;
currentGsm+=2;
/* Increment currentUcs2 for length of Buffer */
currentUcs2++;
/* Set return value to EXTENDED_GSM */
retVal = EXTENDED_GSM7BIT;
}
/* Last Two Characters were not a extended character */
else if(charType == GSM7BIT)
{
ucs2Str_p[currentUcs2] = ucs2Byte;
currentUcs2++;
currentGsm++;
}
else
{
retVal = NON_GSM7BIT;
}
}/* Not Enough Room in buffer to convert two characters */
/* Check for One Character In Buffer, if there is one */
if(currentGsm < gsmDataLength)
{
/* use mapEGsmToUcs2 to convert last character to Ucs2 */
charType = mapEGsmToUcs2(gsmStr_p[currentGsm], NON_GSM, &ucs2Byte);
/* Check Valid Byte was returned */
if(charType == GSM7BIT)
{
/* insert last Ucs2 Byte into ucs2String */
ucs2Str_p[currentUcs2] = ucs2Byte;
/* Increment currentUcs2 for length of buffer */
currentUcs2++;
currentGsm++;
}
else
{
retVal = NON_GSM7BIT;
}
} /* Last Charactert in Buffer */
/* Set Length of Ucs2 String */
(*ucs2Length_p) = currentUcs2;
} /* Invalid String */
return retVal;
}
/////////////////////////////
static const _BYTE Ucs2ToGsm[UCS2_TO_GSM_LOOKUP_TABLE_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x08*/ NON_GSM, NON_GSM, 0x0a, NON_GSM, NON_GSM, 0x0d, NON_GSM, NON_GSM,
/*0x10*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x18*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0x02, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x11,
/*0x60*/ NON_GSM, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x80*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x88*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x90*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x98*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xa0*/ NON_GSM, 0x40, NON_GSM, 0x01, 0x24, 0x03, NON_GSM, 0x5f,
/*0xa8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xb0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xb8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x60,
/*0xc0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x5b, 0x0e, 0x1c, 0x09,
/*0xc8*/ NON_GSM, 0x1f, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x60,
/*0xd0*/ NON_GSM, 0x5d, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x5c, NON_GSM,
/*0xd8*/ 0x0b, NON_GSM, NON_GSM, NON_GSM, 0x5e, NON_GSM, NON_GSM, 0x1e,
/*0xe0*/ 0x7f, NON_GSM, NON_GSM, NON_GSM, 0x7b, 0x0f, 0x1d, NON_GSM,
/*0xe8*/ 0x04, 0x05, NON_GSM, NON_GSM, 0x07, NON_GSM, NON_GSM, NON_GSM,
/*0xf0*/ NON_GSM, 0x7d, 0x08, NON_GSM, NON_GSM, NON_GSM, 0x7c, NON_GSM,
/*0xf8*/ 0x0c, 0x06, NON_GSM, NON_GSM, 0x7e, NON_GSM, NON_GSM, NON_GSM
};
static const _BYTE Ucs2GclToGsm[UCS2_GCL_RANGE + 1] =
{
/*0x0393*/ 0x13, 0x10, NON_GSM, NON_GSM,
/*0x0397*/ NON_GSM, 0x19, NON_GSM, NON_GSM,
/*0x039b*/ 0x14, NON_GSM, NON_GSM, 0x1a,
/*0x039f*/ NON_GSM, 0x16, NON_GSM, NON_GSM,
/*0x03a3*/ 0x18, NON_GSM, NON_GSM, 0x12,
/*0x03a7*/ NON_GSM, 0x17, 0x15, 0x16
};
/*
Convert a ucs2 character value to an extended GSM character.
further reworking so that if the UCS2 value is less than the maximum GSM
character value the extended table is searched.
Parameters:
ucs2 - the ucs2 value to convert to EGSM.
gsm1_p - pointer to first character of EGSM pair (GSM value if not EGSM, ESC if EGSM)
gsm2_p - pointer to second character of EGSM pair (NON_GSM if not EGSM)
returns:
GSM7BIT - if normal GSM character
NON_GSM7BIT - if cannot be represented in GSM or EGSM
EXTENDED_GSM7BIT - if EGSM character (pair)
*/
GsmCharType mapUcs2ToEGsm(_WORD ucs2, _BYTE *gsm1_p, _BYTE *gsm2_p)
{
GsmCharType retVal = NON_GSM7BIT;
_BYTE gsmValue = NON_GSM;
/* Check to see whether the UCS2 character is represented by a single GSM character.
This can be either a 'normal' character or a Greek character. */
if(gsm1_p != NULL && gsm2_p != NULL)
{
if(ucs2 < UCS2_TO_GSM_LOOKUP_TABLE_SIZE)
{
gsmValue = Ucs2ToGsm[ucs2];
*gsm1_p = gsmValue;
*gsm2_p = NON_GSM;
if (gsmValue != NON_GSM)
{
retVal = GSM7BIT;
}
}
else if((ucs2 >= UCS2_GREEK_CAPITAL_LETTER_GAMMA) &&
(ucs2 <= (UCS2_GREEK_CAPITAL_LETTER_GAMMA + UCS2_GCL_RANGE)))
{
gsmValue = Ucs2GclToGsm[(ucs2) - UCS2_GREEK_CAPITAL_LETTER_GAMMA];
*gsm1_p = gsmValue;
*gsm2_p = NON_GSM;
if (gsmValue != NON_GSM)
{
retVal = GSM7BIT;
}
}
/* It's not a single GSM character, so if we want to send it as unicode do nothing,
otherwise try and find the character in the extended GSM table. */
if ( gsmValue == NON_GSM)
{
_BOOL found = FALSE;
_BYTE count = 0;
while((count < GSM_CHARACTER_SET_SIZE) && (found == FALSE))
{
if(ExtendedGsmToUcs2[count] == ucs2)
{
found = TRUE;
}
else
{
count++;
}
}
/* If Ucs2 Character is found in Table insert characters in gsm data buffers
First character is Extended_Alphabet_Table Value (0x1B) to indicate Extended Gsm Character.
Second Gsm character is value returned from loop.
Indicate in return value it is an extended character. */
if (found)
{
*gsm1_p = EXTENDED_ALPHABET_TABLE;
*gsm2_p = count;
retVal = EXTENDED_GSM7BIT;
}
}
} /* gsm1_p and gsm2 != NULL */
return retVal;
}
/*
Converts a Ucs2 string to byte aligned GSM.
Stops when a conversion fails and returns the number of successful conversions performed.
If the destination gsmData equals NULL, don't store the conversion result.
- gsmData_p pointer to gsm string buffer
- ucs2String_p pointer to ucs2 string buffer
- length size of ucs2 string.
- Offset added to take into consideration the extra character
needed for the Exteneded Characters. It is increment by one
every exteneded character so the extra length can be taken into
consideration. e.g. Length = LengthUcs2 + Offset.
- current used to itterate through ucs2 string
*/
GsmCharType ConvUcs2ToEGsm(const _WORD *ucs2Str_p, _WORD ucs2Length, _BYTE *gsmStr_p, _WORD *gsmLength_p)
{
GsmCharType retVal = GSM7BIT;
GsmCharType charType = NON_GSM7BIT;
_WORD currentGsm = 0;
_WORD currentUcs2 = 0;
_BYTE gsmChar1;
_BYTE gsmChar2;
/* Initialise gsm length */
*gsmLength_p = 0;
/* Check for valid gsmStr_p */
if(gsmStr_p != NULL)
{
/* Loop through ucs2 String */
for(currentUcs2 = 0; currentUcs2 < ucs2Length; currentUcs2++)
{
/* use mapUcs2ToEGsm to map ucs2 to gsmCharacters */
charType = mapUcs2ToEGsm(ucs2Str_p[currentUcs2], &gsmChar1, &gsmChar2);
/* If ucs2 character mapped to an Extended Character */
if(charType == EXTENDED_GSM7BIT)
{
/* Set gsmStr to both characters returned in gsmChar1, and gsmChar2 */
gsmStr_p[currentGsm] = gsmChar1;
gsmStr_p[currentGsm+1] = gsmChar2;
/* Increment Length by 2 for Extended Character */
(*gsmLength_p)+=2;
/* Increment currentGsm by 2 to avoid Extended Characters */
currentGsm+=2;
retVal = EXTENDED_GSM7BIT;
}
/* If ucs2 character mapped to normal Gsm Character */
else if(charType == GSM7BIT)
{
/* Store Gsm Character in gsm string */
gsmStr_p[currentGsm] = gsmChar1;
/* Increment Length by 1 */
(*gsmLength_p)++;
/* Increment current Gsm by 1 */
currentGsm++;
}
else
{
/* Invalid Character Found set retVal to NON_GSM*/
retVal = NON_GSM7BIT;
break;
}
}
}
else
{
/* No Valid Gsm Data Buffer return NON_GSM */
retVal = NON_GSM7BIT;
}
return retVal;
}
/*
This function returns the length of the Gsm String as
now with extended Characters we cannot assume a Ucs2
Character is equal to one Byte
- gsmData_p pointer to the buffer for the GsmData can be Null
- ucs2String_p pointer to the Ucs2 String being converted to Gsm
- length length of Ucs2String
*/
GsmCharType GetEGsmLengthOfUcs2(_WORD *ucs2Str_p, _WORD ucs2Length, _WORD *gsmLength_p)
{
GsmCharType retVal = GSM7BIT;
GsmCharType charType = NON_GSM7BIT;
_WORD currentLen = 0;
_BYTE gsmChar1 = 0;
_BYTE gsmChar2 = 0;
/* Initialise gsm Length to 0 */
*gsmLength_p = 0;
/* Loop through Ucs2 String */
while(currentLen < ucs2Length)
{
/* Use mapUcs2ToGsm To determine if ucs2 character can be converted */
charType = mapUcs2ToEGsm(ucs2Str_p[currentLen], &gsmChar1, &gsmChar2);
/* If Ucs2 maps to Extended Character */
if(charType == EXTENDED_GSM7BIT)
{
/* Increment gsmLength by two for the Extended Character */
(*gsmLength_p)+=2;
retVal = EXTENDED_GSM7BIT;
}
/* If Ucs2 maps To Normal Gsm Character */
else if(charType == GSM7BIT)
{
/* Increment gsmLength by 1 for Gsm Character */
(*gsmLength_p)++;
}
else
{
retVal = NON_GSM7BIT;
/* Non Gsm break out of loop */
break;
}
/* Increment currentLen to index next Ucs2 Character */
currentLen++;
}
return retVal;
}
/////////////////////////////
/* code page 437 */
static const _WORD cp437_table[UCS2_TO_GSM_LOOKUP_TABLE_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x2007, 0x253a, 0x253b, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022,
/*0x08*/ 0x25d8, 0x25cb, 0x25d9, 0x2642, 0x2640, 0x266a, 0x266b, 0x263c,
/*0x10*/ 0x25ba, 0x25c4, 0x2195, 0x203c, 0x00b6, 0x00a7, 0x25ac, 0x21a8,
/*0x18*/ 0x2191, 0x2193, 0x2192, 0x2190, 0x221f, 0x2194, 0x25b2, 0x25bc,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
/*0x60*/ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x2302,
/*0x80*/ 0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7,
/*0x88*/ 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5,
/*0x90*/ 0xc9, 0xe5, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9,
/*0x98*/ 0xff, 0xd6, 0xdc, 0xa2, 0xa3, 0xa5, 0xa7, 0x0192,
/*0xa0*/ 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba,
/*0xa8*/ 0xbf, 0x2310, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb,
/*0xb0*/ 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
/*0xb8*/ 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510,
/*0xc0*/ 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f,
/*0xc8*/ 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567,
/*0xd0*/ 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b,
/*0xd8*/ 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580,
/*0xe0*/ 0x03b1, 0x03b2, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0xb5, 0x03c4,
/*0xe8*/ 0x03a6, 0x0398, 0x03a9, 0x03b4, 0x221e, 0x2205, 0x2208, 0x2229,
/*0xf0*/ 0x2261, 0xb1, 0x2265, 0x2264, 0x2320, 0x2321, 0xf7, 0x2248,
/*0xf8*/ 0xb0, 0x2219, 0xb7, 0x221a, 0x207f, 0xb2, 0x25a0, 0xa0
};
/* A modification of CP850 is CP858, differing only in the character at position 0xD5:
a dotless-i (0x0131) in CP850, which is replaced with a euro sign (0x20ac) in CP858.*/
/* code page 858 */
static const _WORD cp858_table[UCS2_TO_GSM_LOOKUP_TABLE_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x2007, 0x253a, 0x253b, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022,
/*0x08*/ 0x25d8, 0x25cb, 0x25d9, 0x2642, 0x2640, 0x266a, 0x266b, 0x263c,
/*0x10*/ 0x25ba, 0x25c4, 0x2195, 0x203c, 0x00b6, 0x00a7, 0x25ac, 0x21a8,
/*0x18*/ 0x2191, 0x2193, 0x2192, 0x2190, 0x221f, 0x2194, 0x25b2, 0x25bc,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
/*0x60*/ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x2302,
/*0x80*/ 0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7,
/*0x88*/ 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5,
/*0x90*/ 0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9,
/*0x98*/ 0xff, 0xd6, 0xdc, 0xf8, 0xa3, 0xd8, 0xd7, 0x0192,
/*0xa0*/ 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba,
/*0xa8*/ 0xbf, 0xae, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb,
/*0xb0*/ 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0xc1, 0xc2, 0xc0,
/*0xb8*/ 0xa9, 0x2563, 0x2551, 0x2557, 0x255d, 0xa2, 0xa5, 0x2510,
/*0xc0*/ 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0xe3, 0xc3,
/*0xc8*/ 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0xa4,
/*0xd0*/ 0xf0, 0xd0, 0xca, 0xcb, 0xc8, 0x20ac, 0xcd, 0xce,
/*0xd8*/ 0xcf, 0x2518, 0x250c, 0x2588, 0x2584, 0xa5, 0xcc, 0x2580,
/*0xe0*/ 0xd3, 0xdf, 0xd4, 0xd2, 0xf5, 0xd5, 0xb5, 0xfe,
/*0xe8*/ 0xde, 0xda, 0xdb, 0xd9, 0xfd, 0xdd, 0xaf, 0xb4,
/*0xf0*/ 0xad, 0xb1, 0x2017, 0xbe, 0xb6, 0xa7, 0xf7, 0xb8,
/*0xf8*/ 0xb0, 0xa8, 0xb7, 0xb9, 0xb3, 0xb2, 0x25a0, 0xa0
};
/* cp1252, ansi */
static const _WORD cp1252_table[UCS2_TO_GSM_LOOKUP_TABLE_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
/*0x08*/ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
/*0x10*/ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
/*0x18*/ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
/*0x60*/ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
/*0x80*/ 0x20ac, 0, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
/*0x88*/ 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0, 0x017d, 0,
/*0x90*/ 0, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
/*0x98*/ 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0, 0x017e, 0x0178,
/*0xa0*/ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
/*0xa8*/ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
/*0xb0*/ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
/*0xb8*/ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
/*0xc0*/ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
/*0xc8*/ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
/*0xd0*/ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
/*0xd8*/ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
/*0xe0*/ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
/*0xe8*/ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
/*0xf0*/ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
/*0xf8*/ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
};
/* iso-8859-15 */
static const _WORD ISO_8859_15_table[UCS2_TO_GSM_LOOKUP_TABLE_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
/*0x08*/ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
/*0x10*/ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
/*0x18*/ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
/*0x60*/ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
/*0x80*/ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
/*0x88*/ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
/*0x90*/ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
/*0x98*/ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
/*0xa0*/ 0xa0, 0xa1, 0xa2, 0xa3, 0x20ac, 0xa5, 0x0160, 0xa7,
/*0xa8*/ 0x0161, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
/*0xb0*/ 0xb0, 0xb1, 0xb2, 0xb3, 0x017d, 0xb5, 0xb6, 0xb7,
/*0xb8*/ 0x017e, 0xb9, 0xba, 0xbb, 0x0152, 0x0153, 0x0178, 0xbf,
/*0xc0*/ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
/*0xc8*/ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
/*0xd0*/ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
/*0xd8*/ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
/*0xe0*/ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
/*0xe8*/ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
/*0xf0*/ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
/*0xf8*/ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
};
//////////////////
static const _BYTE GsmToCP437[GSM_CHARACTER_SET_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x40, 0x9c, 0x24, 0x9d, 0x8a, 0x82, 0x97, 0x8d,
/*0x08*/ 0x95, 0x80, 0, 0, 0, 0, 0x8f, 0x86,
/*0x10*/ 0, 0x5f, 0xe8, 0xe2, 0, 0xea, 0, 0,
/*0x18*/ 0xe4, 0xe9, 0, 0x20, 0x92, 0, 0, 0x90,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0xad, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0x8e, 0x99, 0xa5, 0x9a, 0x15,
/*0x60*/ 0xa8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0x84, 0x94, 0xa4, 0x81, 0x85,
};
static const _BYTE GsmToCP858[GSM_CHARACTER_SET_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x40, 0x9c, 0x24, 0xbe, 0x8a, 0x82, 0x97, 0x8d,
/*0x08*/ 0x95, 0x80, 0, 0x9d, 0x9b, 0, 0x8f, 0x86,
/*0x10*/ 0, 0x5f, 0, 0, 0, 0, 0, 0,
/*0x18*/ 0, 0, 0, 0x20, 0x92, 0x91, 0xe1, 0x90,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0xcf, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0xad, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0x8e, 0x99, 0xa5, 0x9a, 0x15,
/*0x60*/ 0xa8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0x84, 0x94, 0xa4, 0x81, 0x85,
};
static const _BYTE GsmToCP1252[GSM_CHARACTER_SET_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x40, 0xa3, 0x24, 0xa5, 0xe8, 0xe9, 0xf9, 0xec,
/*0x08*/ 0xf2, 0xc7, 0x0a, 0xd8, 0xf8, 0x0d, 0xc5, 0xe5,
/*0x10*/ 0, 0x5f, 0, 0, 0, 0, 0, 0,
/*0x18*/ 0, 0, 0, 0x20, 0xc6, 0xe6, 0xdf, 0xc9,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0xa4, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0xa1, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0xc4, 0xd6, 0xd1, 0xdc, 0xa7,
/*0x60*/ 0xbf, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0xe4, 0xf6, 0xf1, 0xfc, 0xe0,
};
static const _BYTE GsmToIso8859_15[GSM_CHARACTER_SET_SIZE] =
{ /* +0x0 +0x1 +0x2 +0x3 +0x4 +0x5 +0x6 +0x7 */
/*0x00*/ 0x40, 0xa3, 0x24, 0xa5, 0xe8, 0xe9, 0xf9, 0xec,
/*0x08*/ 0xf2, 0xc7, 0x0a, 0xd8, 0xf8, 0x0d, 0xc5, 0xe5,
/*0x10*/ 0, 0x5f, 0, 0, 0, 0, 0, 0,
/*0x18*/ 0, 0, 0, 0x20, 0xc6, 0xe6, 0xdf, 0xc9,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0xa1, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0xc4, 0xd6, 0xd1, 0xdc, 0xa7,
/*0x60*/ 0xbf, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0xe4, 0xf6, 0xf1, 0xfc, 0xe0,
};
///////////////////////
static const _BYTE ascii_to_extension_gsm1[] =
{
// 0x5b, 0x5c, 0x5d, 0x5e
0x3c, 0x2f, 0x3e, 0x14
};
static const _BYTE ascii_to_extension_gsm2[] =
{
// 0x7b, 0x7c, 0x7d, 0x7e
0x28, 0x40, 0x29, 0x3d
};
static const _BYTE iso_8859_15_to_gsm[UCS2_TO_GSM_LOOKUP_TABLE_SIZE] =
{
/*0x00*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x08*/ NON_GSM, NON_GSM, 0x0a, NON_GSM, NON_GSM, 0x0d, NON_GSM, NON_GSM,
/*0x10*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x18*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0x02, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0x1b, 0x1b, 0x1b, 0x1b, 0x11,
/*0x60*/ NON_GSM, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0x1b, 0x1b, 0x1b, 0x1b, NON_GSM,
/*0x80*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x88*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x90*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x98*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xa0*/ NON_GSM, 0x40, NON_GSM, 0x01, 0x1b, 0x03, NON_GSM, 0x5f,
/*0xa8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xb0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xb8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x60,
/*0xc0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x5b, 0x0e, 0x1c, 0x09,
/*0xc8*/ NON_GSM, 0x1f, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xd0*/ NON_GSM, 0x5d, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x5c, NON_GSM,
/*0xd8*/ 0x0b, NON_GSM, NON_GSM, NON_GSM, 0x5e, NON_GSM, NON_GSM, 0x1e,
/*0xe0*/ 0x7f, NON_GSM, NON_GSM, NON_GSM, 0x7b, 0x0f, 0x1d, NON_GSM,
/*0xe8*/ 0x04, 0x05, NON_GSM, NON_GSM, 0x07, NON_GSM, NON_GSM, NON_GSM,
/*0xf0*/ NON_GSM, 0x7d, 0x08, NON_GSM, NON_GSM, NON_GSM, 0x7c, NON_GSM,
/*0xf8*/ 0x0c, 0x06, NON_GSM, NON_GSM, 0x7e, NON_GSM, NON_GSM, NON_GSM
};
static const _BYTE cp858_to_gsm[UCS2_TO_GSM_LOOKUP_TABLE_SIZE] =
{
/*0x00*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x08*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x10*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x5f, NON_GSM, NON_GSM,
/*0x18*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x20*/ 0x20, 0x21, 0x22, 0x23, 0x02, 0x25, 0x26, 0x27,
/*0x28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
/*0x30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
/*0x38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
/*0x40*/ 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
/*0x48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
/*0x50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
/*0x58*/ 0x58, 0x59, 0x5a, 0x1b, 0x1b, 0x1b, 0x1b, 0x11,
/*0x60*/ NON_GSM, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/*0x68*/ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
/*0x70*/ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
/*0x78*/ 0x78, 0x79, 0x7a, 0x1b, 0x1b, 0x1b, 0x1b, NON_GSM,
/*0x80*/ 0x09, 0x7e, 0x05, NON_GSM, 0x7b, 0x7f, 0x0f, NON_GSM,
/*0x88*/ NON_GSM, NON_GSM, 0x04, NON_GSM, NON_GSM, 0x07, 0x5b, 0x0e,
/*0x90*/ 0x1f, 0x1d, 0x1c, NON_GSM, 0x7c, 0x08, NON_GSM, 0x06,
/*0x98*/ NON_GSM, 0x5c, 0x5e, 0x0c, 0x01, 0x0b, NON_GSM, NON_GSM,
/*0xa0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x7d, 0x5d, NON_GSM, NON_GSM,
/*0xa8*/ 0x60, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x40, NON_GSM, NON_GSM,
/*0xb0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xb8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x03, NON_GSM,
/*0xc0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xc8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x24,
/*0xd0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x1b, NON_GSM, NON_GSM,
/*0xd8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x03, NON_GSM, NON_GSM,
/*0xe0*/ NON_GSM, 0x1e, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xe8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0xf0*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, 0x5f, NON_GSM, NON_GSM,
/*0xf8*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM
};
static const _BYTE cp1252_to_gsm[UCS2_TO_GSM_LOOKUP_TABLE_SIZE] =
{
/*0x00*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x08*/ NON_GSM, NON_GSM, 0x0a, NON_GSM, NON_GSM, 0x0d, NON_GSM, NON_GSM,
/*0x10*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,
/*0x18*/ NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM, NON_GSM,