aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/csets.adb
blob: 97b21fa2ea890fe693474a8536f0d59055e4342d (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
------------------------------------------------------------------------------
--                                                                          --
--                         GNAT COMPILER COMPONENTS                         --
--                                                                          --
--                                C S E T S                                 --
--                                                                          --
--                                 B o d y                                  --
--                                                                          --
--          Copyright (C) 1992-2013, Free Software Foundation, Inc.         --
--                                                                          --
-- GNAT is free software;  you can  redistribute it  and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
--                                                                          --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception,   --
-- version 3.1, as published by the Free Software Foundation.               --
--                                                                          --
-- You should have received a copy of the GNU General Public License and    --
-- a copy of the GCC Runtime Library Exception along with this program;     --
-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
-- <http://www.gnu.org/licenses/>.                                          --
--                                                                          --
-- GNAT was originally developed  by the GNAT team at  New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc.      --
--                                                                          --
------------------------------------------------------------------------------

with Opt;   use Opt;

with System.WCh_Con; use System.WCh_Con;

package body Csets is

   X_80 : constant Character := Character'Val (16#80#);
   X_81 : constant Character := Character'Val (16#81#);
   X_82 : constant Character := Character'Val (16#82#);
   X_83 : constant Character := Character'Val (16#83#);
   X_84 : constant Character := Character'Val (16#84#);
   X_85 : constant Character := Character'Val (16#85#);
   X_86 : constant Character := Character'Val (16#86#);
   X_87 : constant Character := Character'Val (16#87#);
   X_88 : constant Character := Character'Val (16#88#);
   X_89 : constant Character := Character'Val (16#89#);
   X_8A : constant Character := Character'Val (16#8A#);
   X_8B : constant Character := Character'Val (16#8B#);
   X_8C : constant Character := Character'Val (16#8C#);
   X_8D : constant Character := Character'Val (16#8D#);
   X_8E : constant Character := Character'Val (16#8E#);
   X_8F : constant Character := Character'Val (16#8F#);
   X_90 : constant Character := Character'Val (16#90#);
   X_91 : constant Character := Character'Val (16#91#);
   X_92 : constant Character := Character'Val (16#92#);
   X_93 : constant Character := Character'Val (16#93#);
   X_94 : constant Character := Character'Val (16#94#);
   X_95 : constant Character := Character'Val (16#95#);
   X_96 : constant Character := Character'Val (16#96#);
   X_97 : constant Character := Character'Val (16#97#);
   X_98 : constant Character := Character'Val (16#98#);
   X_99 : constant Character := Character'Val (16#99#);
   X_9A : constant Character := Character'Val (16#9A#);
   X_9B : constant Character := Character'Val (16#9B#);
   X_9C : constant Character := Character'Val (16#9C#);
   X_9D : constant Character := Character'Val (16#9D#);
   X_9E : constant Character := Character'Val (16#9E#);
   X_9F : constant Character := Character'Val (16#9F#);
   X_A0 : constant Character := Character'Val (16#A0#);
   X_A1 : constant Character := Character'Val (16#A1#);
   X_A2 : constant Character := Character'Val (16#A2#);
   X_A3 : constant Character := Character'Val (16#A3#);
   X_A4 : constant Character := Character'Val (16#A4#);
   X_A5 : constant Character := Character'Val (16#A5#);
   X_A6 : constant Character := Character'Val (16#A6#);
   X_A7 : constant Character := Character'Val (16#A7#);
   X_A8 : constant Character := Character'Val (16#A8#);
   X_A9 : constant Character := Character'Val (16#A9#);
   X_AA : constant Character := Character'Val (16#AA#);
   X_AB : constant Character := Character'Val (16#AB#);
   X_AC : constant Character := Character'Val (16#AC#);
   X_AD : constant Character := Character'Val (16#AD#);
   X_AE : constant Character := Character'Val (16#AE#);
   X_AF : constant Character := Character'Val (16#AF#);
   X_B0 : constant Character := Character'Val (16#B0#);
   X_B1 : constant Character := Character'Val (16#B1#);
   X_B2 : constant Character := Character'Val (16#B2#);
   X_B3 : constant Character := Character'Val (16#B3#);
   X_B4 : constant Character := Character'Val (16#B4#);
   X_B5 : constant Character := Character'Val (16#B5#);
   X_B6 : constant Character := Character'Val (16#B6#);
   X_B7 : constant Character := Character'Val (16#B7#);
   X_B8 : constant Character := Character'Val (16#B8#);
   X_B9 : constant Character := Character'Val (16#B9#);
   X_BA : constant Character := Character'Val (16#BA#);
   X_BB : constant Character := Character'Val (16#BB#);
   X_BC : constant Character := Character'Val (16#BC#);
   X_BD : constant Character := Character'Val (16#BD#);
   X_BE : constant Character := Character'Val (16#BE#);
   X_BF : constant Character := Character'Val (16#BF#);
   X_C0 : constant Character := Character'Val (16#C0#);
   X_C1 : constant Character := Character'Val (16#C1#);
   X_C2 : constant Character := Character'Val (16#C2#);
   X_C3 : constant Character := Character'Val (16#C3#);
   X_C4 : constant Character := Character'Val (16#C4#);
   X_C5 : constant Character := Character'Val (16#C5#);
   X_C6 : constant Character := Character'Val (16#C6#);
   X_C7 : constant Character := Character'Val (16#C7#);
   X_C8 : constant Character := Character'Val (16#C8#);
   X_C9 : constant Character := Character'Val (16#C9#);
   X_CA : constant Character := Character'Val (16#CA#);
   X_CB : constant Character := Character'Val (16#CB#);
   X_CC : constant Character := Character'Val (16#CC#);
   X_CD : constant Character := Character'Val (16#CD#);
   X_CE : constant Character := Character'Val (16#CE#);
   X_CF : constant Character := Character'Val (16#CF#);
   X_D0 : constant Character := Character'Val (16#D0#);
   X_D1 : constant Character := Character'Val (16#D1#);
   X_D2 : constant Character := Character'Val (16#D2#);
   X_D3 : constant Character := Character'Val (16#D3#);
   X_D4 : constant Character := Character'Val (16#D4#);
   X_D5 : constant Character := Character'Val (16#D5#);
   X_D6 : constant Character := Character'Val (16#D6#);
   X_D7 : constant Character := Character'Val (16#D7#);
   X_D8 : constant Character := Character'Val (16#D8#);
   X_D9 : constant Character := Character'Val (16#D9#);
   X_DA : constant Character := Character'Val (16#DA#);
   X_DB : constant Character := Character'Val (16#DB#);
   X_DC : constant Character := Character'Val (16#DC#);
   X_DD : constant Character := Character'Val (16#DD#);
   X_DE : constant Character := Character'Val (16#DE#);
   X_DF : constant Character := Character'Val (16#DF#);
   X_E0 : constant Character := Character'Val (16#E0#);
   X_E1 : constant Character := Character'Val (16#E1#);
   X_E2 : constant Character := Character'Val (16#E2#);
   X_E3 : constant Character := Character'Val (16#E3#);
   X_E4 : constant Character := Character'Val (16#E4#);
   X_E5 : constant Character := Character'Val (16#E5#);
   X_E6 : constant Character := Character'Val (16#E6#);
   X_E7 : constant Character := Character'Val (16#E7#);
   X_E8 : constant Character := Character'Val (16#E8#);
   X_E9 : constant Character := Character'Val (16#E9#);
   X_EA : constant Character := Character'Val (16#EA#);
   X_EB : constant Character := Character'Val (16#EB#);
   X_EC : constant Character := Character'Val (16#EC#);
   X_ED : constant Character := Character'Val (16#ED#);
   X_EE : constant Character := Character'Val (16#EE#);
   X_EF : constant Character := Character'Val (16#EF#);
   X_F0 : constant Character := Character'Val (16#F0#);
   X_F1 : constant Character := Character'Val (16#F1#);
   X_F2 : constant Character := Character'Val (16#F2#);
   X_F3 : constant Character := Character'Val (16#F3#);
   X_F4 : constant Character := Character'Val (16#F4#);
   X_F5 : constant Character := Character'Val (16#F5#);
   X_F6 : constant Character := Character'Val (16#F6#);
   X_F7 : constant Character := Character'Val (16#F7#);
   X_F8 : constant Character := Character'Val (16#F8#);
   X_F9 : constant Character := Character'Val (16#F9#);
   X_FA : constant Character := Character'Val (16#FA#);
   X_FB : constant Character := Character'Val (16#FB#);
   X_FC : constant Character := Character'Val (16#FC#);
   X_FD : constant Character := Character'Val (16#FD#);
   X_FE : constant Character := Character'Val (16#FE#);
   X_FF : constant Character := Character'Val (16#FF#);

   ------------------------------------------
   -- Definitions for Latin-1 (ISO 8859-1) --
   ------------------------------------------

   Fold_Latin_1 : constant Translate_Table := Translate_Table'(

      'a' => 'A',  X_E0 => X_C0,  X_F0 => X_D0,
      'b' => 'B',  X_E1 => X_C1,  X_F1 => X_D1,
      'c' => 'C',  X_E2 => X_C2,  X_F2 => X_D2,
      'd' => 'D',  X_E3 => X_C3,  X_F3 => X_D3,
      'e' => 'E',  X_E4 => X_C4,  X_F4 => X_D4,
      'f' => 'F',  X_E5 => X_C5,  X_F5 => X_D5,
      'g' => 'G',  X_E6 => X_C6,  X_F6 => X_D6,
      'h' => 'H',  X_E7 => X_C7,
      'i' => 'I',  X_E8 => X_C8,  X_F8 => X_D8,
      'j' => 'J',  X_E9 => X_C9,  X_F9 => X_D9,
      'k' => 'K',  X_EA => X_CA,  X_FA => X_DA,
      'l' => 'L',  X_EB => X_CB,  X_FB => X_DB,
      'm' => 'M',  X_EC => X_CC,  X_FC => X_DC,
      'n' => 'N',  X_ED => X_CD,  X_FD => X_DD,
      'o' => 'O',  X_EE => X_CE,  X_FE => X_DE,
      'p' => 'P',  X_EF => X_CF,
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',  X_C0 => X_C0,  X_D0 => X_D0,
      'B' => 'B',  X_C1 => X_C1,  X_D1 => X_D1,
      'C' => 'C',  X_C2 => X_C2,  X_D2 => X_D2,
      'D' => 'D',  X_C3 => X_C3,  X_D3 => X_D3,
      'E' => 'E',  X_C4 => X_C4,  X_D4 => X_D4,
      'F' => 'F',  X_C5 => X_C5,  X_D5 => X_D5,
      'G' => 'G',  X_C6 => X_C6,  X_D6 => X_D6,
      'H' => 'H',  X_C7 => X_C7,
      'I' => 'I',  X_C8 => X_C8,  X_D8 => X_D8,
      'J' => 'J',  X_C9 => X_C9,  X_D9 => X_D9,
      'K' => 'K',  X_CA => X_CA,  X_DA => X_DA,
      'L' => 'L',  X_CB => X_CB,  X_DB => X_DB,
      'M' => 'M',  X_CC => X_CC,  X_DC => X_DC,
      'N' => 'N',  X_CD => X_CD,  X_DD => X_DD,
      'O' => 'O',  X_CE => X_CE,  X_DE => X_DE,
      'P' => 'P',  X_CF => X_CF,  X_DF => X_DF,  X_FF => X_FF,
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   ------------------------------------------
   -- Definitions for Latin-2 (ISO 8859-2) --
   ------------------------------------------

   Fold_Latin_2 : constant Translate_Table := Translate_Table'(

      'a' => 'A',  X_E0 => X_C0,  X_F0 => X_D0,
      'b' => 'B',  X_E1 => X_C1,  X_F1 => X_D1,  X_B1 => X_A1,
      'c' => 'C',  X_E2 => X_C2,  X_F2 => X_D2,
      'd' => 'D',  X_E3 => X_C3,  X_F3 => X_D3,  X_B3 => X_A3,
      'e' => 'E',  X_E4 => X_C4,  X_F4 => X_D4,
      'f' => 'F',  X_E5 => X_C5,  X_F5 => X_D5,  X_B5 => X_A5,
      'g' => 'G',  X_E6 => X_C6,  X_F6 => X_D6,  X_B6 => X_A6,
      'h' => 'H',  X_E7 => X_C7,
      'i' => 'I',  X_E8 => X_C8,  X_F8 => X_D8,
      'j' => 'J',  X_E9 => X_C9,  X_F9 => X_D9,  X_B9 => X_A9,
      'k' => 'K',  X_EA => X_CA,  X_FA => X_DA,  X_BA => X_AA,
      'l' => 'L',  X_EB => X_CB,  X_FB => X_DB,  X_BB => X_AB,
      'm' => 'M',  X_EC => X_CC,  X_FC => X_DC,  X_BC => X_AC,
      'n' => 'N',  X_ED => X_CD,  X_FD => X_DD,
      'o' => 'O',  X_EE => X_CE,  X_FE => X_DE,  X_BE => X_AE,
      'p' => 'P',  X_EF => X_CF,  X_FF => X_DF,  X_BF => X_AF,
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',  X_C0 => X_C0,  X_D0 => X_D0,
      'B' => 'B',  X_C1 => X_C1,  X_D1 => X_D1,  X_A1 => X_A1,
      'C' => 'C',  X_C2 => X_C2,  X_D2 => X_D2,
      'D' => 'D',  X_C3 => X_C3,  X_D3 => X_D3,  X_A3 => X_A3,
      'E' => 'E',  X_C4 => X_C4,  X_D4 => X_D4,
      'F' => 'F',  X_C5 => X_C5,  X_D5 => X_D5,  X_A5 => X_A5,
      'G' => 'G',  X_C6 => X_C6,  X_D6 => X_D6,  X_A6 => X_A6,
      'H' => 'H',  X_C7 => X_C7,
      'I' => 'I',  X_C8 => X_C8,  X_D8 => X_D8,
      'J' => 'J',  X_C9 => X_C9,  X_D9 => X_D9,  X_A9 => X_A9,
      'K' => 'K',  X_CA => X_CA,  X_DA => X_DA,  X_AA => X_AA,
      'L' => 'L',  X_CB => X_CB,  X_DB => X_DB,  X_AB => X_AB,
      'M' => 'M',  X_CC => X_CC,  X_DC => X_DC,  X_AC => X_AC,
      'N' => 'N',  X_CD => X_CD,  X_DD => X_DD,
      'O' => 'O',  X_CE => X_CE,  X_DE => X_DE,  X_AE => X_AE,
      'P' => 'P',  X_CF => X_CF,  X_DF => X_DF,  X_AF => X_AF,
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   ------------------------------------------
   -- Definitions for Latin-3 (ISO 8859-3) --
   ------------------------------------------

   Fold_Latin_3 : constant Translate_Table := Translate_Table'(

      'a' => 'A',  X_E0 => X_C0,
      'b' => 'B',  X_E1 => X_C1,  X_F1 => X_D1,  X_B1 => X_A1,
      'c' => 'C',  X_E2 => X_C2,  X_F2 => X_D2,
      'd' => 'D',                 X_F3 => X_D3,
      'e' => 'E',  X_E4 => X_C4,  X_F4 => X_D4,
      'f' => 'F',  X_E5 => X_C5,  X_F5 => X_D5,  X_B5 => X_A5,
      'g' => 'G',  X_E6 => X_C6,  X_F6 => X_D6,  X_B6 => X_A6,
      'h' => 'H',  X_E7 => X_C7,
      'i' => 'I',  X_E8 => X_C8,  X_F8 => X_D8,
      'j' => 'J',  X_E9 => X_C9,  X_F9 => X_D9,  X_B9 => X_A9,
      'k' => 'K',  X_EA => X_CA,  X_FA => X_DA,  X_BA => X_AA,
      'l' => 'L',  X_EB => X_CB,  X_FB => X_DB,  X_BB => X_AB,
      'm' => 'M',  X_EC => X_CC,  X_FC => X_DC,  X_BC => X_AC,
      'n' => 'N',  X_ED => X_CD,  X_FD => X_DD,
      'o' => 'O',  X_EE => X_CE,  X_FE => X_DE,
      'p' => 'P',  X_EF => X_CF,                 X_BF => X_AF,
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',  X_C0 => X_C0,
      'B' => 'B',  X_C1 => X_C1,  X_D1 => X_D1,  X_A1 => X_A1,
      'C' => 'C',  X_C2 => X_C2,  X_D2 => X_D2,
      'D' => 'D',                 X_D3 => X_D3,
      'E' => 'E',  X_C4 => X_C4,  X_D4 => X_D4,
      'F' => 'F',  X_C5 => X_C5,  X_D5 => X_D5,  X_A5 => X_A5,
      'G' => 'G',  X_C6 => X_C6,  X_D6 => X_D6,  X_A6 => X_A6,
      'H' => 'H',  X_C7 => X_C7,
      'I' => 'I',  X_C8 => X_C8,  X_D8 => X_D8,
      'J' => 'J',  X_C9 => X_C9,  X_D9 => X_D9,  X_A9 => X_A9,
      'K' => 'K',  X_CA => X_CA,  X_DA => X_DA,  X_AA => X_AA,
      'L' => 'L',  X_CB => X_CB,  X_DB => X_DB,  X_AB => X_AB,
      'M' => 'M',  X_CC => X_CC,  X_DC => X_DC,  X_AC => X_AC,
      'N' => 'N',  X_CD => X_CD,  X_DD => X_DD,
      'O' => 'O',  X_CE => X_CE,  X_DE => X_DE,
      'P' => 'P',  X_CF => X_CF,                 X_AF => X_AF,
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   ------------------------------------------
   -- Definitions for Latin-4 (ISO 8859-4) --
   ------------------------------------------

   Fold_Latin_4 : constant Translate_Table := Translate_Table'(

      'a' => 'A',  X_E0 => X_C0,  X_F0 => X_D0,
      'b' => 'B',  X_E1 => X_C1,  X_F1 => X_D1,  X_B1 => X_A1,
      'c' => 'C',  X_E2 => X_C2,  X_F2 => X_D2,
      'd' => 'D',  X_E3 => X_C3,  X_F3 => X_D3,  X_B3 => X_A3,
      'e' => 'E',  X_E4 => X_C4,  X_F4 => X_D4,
      'f' => 'F',  X_E5 => X_C5,  X_F5 => X_D5,  X_B5 => X_A5,
      'g' => 'G',  X_E6 => X_C6,  X_F6 => X_D6,  X_B6 => X_A6,
      'h' => 'H',  X_E7 => X_C7,
      'i' => 'I',  X_E8 => X_C8,  X_F8 => X_D8,
      'j' => 'J',  X_E9 => X_C9,  X_F9 => X_D9,  X_B9 => X_A9,
      'k' => 'K',  X_EA => X_CA,  X_FA => X_DA,  X_BA => X_AA,
      'l' => 'L',  X_EB => X_CB,  X_FB => X_DB,  X_BB => X_AB,
      'm' => 'M',  X_EC => X_CC,  X_FC => X_DC,  X_BC => X_AC,
      'n' => 'N',  X_ED => X_CD,  X_FD => X_DD,
      'o' => 'O',  X_EE => X_CE,  X_FE => X_DE,  X_BE => X_AE,
      'p' => 'P',  X_EF => X_CF,
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',  X_C0 => X_C0,  X_D0 => X_D0,
      'B' => 'B',  X_C1 => X_C1,  X_D1 => X_D1,  X_A1 => X_A1,
      'C' => 'C',  X_C2 => X_C2,  X_D2 => X_D2,
      'D' => 'D',  X_C3 => X_C3,  X_D3 => X_D3,  X_A3 => X_A3,
      'E' => 'E',  X_C4 => X_C4,  X_D4 => X_D4,
      'F' => 'F',  X_C5 => X_C5,  X_D5 => X_D5,  X_A5 => X_A5,
      'G' => 'G',  X_C6 => X_C6,  X_D6 => X_D6,  X_A6 => X_A6,
      'H' => 'H',  X_C7 => X_C7,
      'I' => 'I',  X_C8 => X_C8,  X_D8 => X_D8,
      'J' => 'J',  X_C9 => X_C9,  X_D9 => X_D9,  X_A9 => X_A9,
      'K' => 'K',  X_CA => X_CA,  X_DA => X_DA,  X_AA => X_AA,
      'L' => 'L',  X_CB => X_CB,  X_DB => X_DB,  X_AB => X_AB,
      'M' => 'M',  X_CC => X_CC,  X_DC => X_DC,  X_AC => X_AC,
      'N' => 'N',  X_CD => X_CD,  X_DD => X_DD,
      'O' => 'O',  X_CE => X_CE,  X_DE => X_DE,  X_AE => X_AE,
      'P' => 'P',  X_CF => X_CF,
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   -------------------------------------------
   -- Definitions for Cyrillic (ISO-8859-5) --
   -------------------------------------------

   Fold_Cyrillic : constant Translate_Table := Translate_Table'(

      'a' => 'A',  X_D0 => X_B0,  X_E0 => X_C0,
      'b' => 'B',  X_D1 => X_B1,  X_E1 => X_C1,  X_F1 => X_A1,
      'c' => 'C',  X_D2 => X_B2,  X_E2 => X_C2,  X_F2 => X_A2,
      'd' => 'D',  X_D3 => X_B3,  X_E3 => X_C3,  X_F3 => X_A3,
      'e' => 'E',  X_D4 => X_B4,  X_E4 => X_C4,  X_F4 => X_A4,
      'f' => 'F',  X_D5 => X_B5,  X_E5 => X_C5,  X_F5 => X_A5,
      'g' => 'G',  X_D6 => X_B6,  X_E6 => X_C6,  X_F6 => X_A6,
      'h' => 'H',  X_D7 => X_B7,  X_E7 => X_C7,  X_F7 => X_A7,
      'i' => 'I',  X_D8 => X_B8,  X_E8 => X_C8,  X_F8 => X_A8,
      'j' => 'J',  X_D9 => X_B9,  X_E9 => X_C9,  X_F9 => X_A9,
      'k' => 'K',  X_DA => X_BA,  X_EA => X_CA,  X_FA => X_AA,
      'l' => 'L',  X_DB => X_BB,  X_EB => X_CB,  X_FB => X_AB,
      'm' => 'M',  X_DC => X_BC,  X_EC => X_CC,  X_FC => X_AC,
      'n' => 'N',  X_DD => X_BD,  X_ED => X_CD,
      'o' => 'O',  X_DE => X_BE,  X_EE => X_CE,  X_FE => X_AE,
      'p' => 'P',  X_DF => X_BF,  X_EF => X_CF,  X_FF => X_AF,
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',  X_B0 => X_B0,  X_C0 => X_C0,
      'B' => 'B',  X_B1 => X_B1,  X_C1 => X_C1,  X_A1 => X_A1,
      'C' => 'C',  X_B2 => X_B2,  X_C2 => X_C2,  X_A2 => X_A2,
      'D' => 'D',  X_B3 => X_B3,  X_C3 => X_C3,  X_A3 => X_A3,
      'E' => 'E',  X_B4 => X_B4,  X_C4 => X_C4,  X_A4 => X_A4,
      'F' => 'F',  X_B5 => X_B5,  X_C5 => X_C5,  X_A5 => X_A5,
      'G' => 'G',  X_B6 => X_B6,  X_C6 => X_C6,  X_A6 => X_A6,
      'H' => 'H',  X_B7 => X_B7,  X_C7 => X_C7,  X_A7 => X_A7,
      'I' => 'I',  X_B8 => X_B8,  X_C8 => X_C8,  X_A8 => X_A8,
      'J' => 'J',  X_B9 => X_B9,  X_C9 => X_C9,  X_A9 => X_A9,
      'K' => 'K',  X_BA => X_BA,  X_CA => X_CA,  X_AA => X_AA,
      'L' => 'L',  X_BB => X_BB,  X_CB => X_CB,  X_AB => X_AB,
      'M' => 'M',  X_BC => X_BC,  X_CC => X_CC,  X_AC => X_AC,
      'N' => 'N',  X_BD => X_BD,  X_CD => X_CD,
      'O' => 'O',  X_BE => X_BE,  X_CE => X_CE,  X_AE => X_AE,
      'P' => 'P',  X_BF => X_BF,  X_CF => X_CF,  X_AF => X_AF,
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   -------------------------------------------
   -- Definitions for Latin-9 (ISO 8859-15) --
   -------------------------------------------

   Fold_Latin_9 : constant Translate_Table := Translate_Table'(

      'a' => 'A',  X_E0 => X_C0,  X_F0 => X_D0,
      'b' => 'B',  X_E1 => X_C1,  X_F1 => X_D1,
      'c' => 'C',  X_E2 => X_C2,  X_F2 => X_D2,
      'd' => 'D',  X_E3 => X_C3,  X_F3 => X_D3,
      'e' => 'E',  X_E4 => X_C4,  X_F4 => X_D4,
      'f' => 'F',  X_E5 => X_C5,  X_F5 => X_D5,
      'g' => 'G',  X_E6 => X_C6,  X_F6 => X_D6,
      'h' => 'H',  X_E7 => X_C7,
      'i' => 'I',  X_E8 => X_C8,  X_F8 => X_D8,
      'j' => 'J',  X_E9 => X_C9,  X_F9 => X_D9,
      'k' => 'K',  X_EA => X_CA,  X_FA => X_DA,
      'l' => 'L',  X_EB => X_CB,  X_FB => X_DB,
      'm' => 'M',  X_EC => X_CC,  X_FC => X_DC,
      'n' => 'N',  X_ED => X_CD,  X_FD => X_DD,
      'o' => 'O',  X_EE => X_CE,  X_FE => X_DE,
      'p' => 'P',  X_EF => X_CF,
      'q' => 'Q',  X_A8 => X_A6,
      'r' => 'R',  X_B8 => X_B4,
      's' => 'S',  X_BD => X_BC,
      't' => 'T',  X_BE => X_FF,
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',  X_C0 => X_C0,  X_D0 => X_D0,
      'B' => 'B',  X_C1 => X_C1,  X_D1 => X_D1,
      'C' => 'C',  X_C2 => X_C2,  X_D2 => X_D2,
      'D' => 'D',  X_C3 => X_C3,  X_D3 => X_D3,
      'E' => 'E',  X_C4 => X_C4,  X_D4 => X_D4,
      'F' => 'F',  X_C5 => X_C5,  X_D5 => X_D5,
      'G' => 'G',  X_C6 => X_C6,  X_D6 => X_D6,
      'H' => 'H',  X_C7 => X_C7,
      'I' => 'I',  X_C8 => X_C8,  X_D8 => X_D8,
      'J' => 'J',  X_C9 => X_C9,  X_D9 => X_D9,
      'K' => 'K',  X_CA => X_CA,  X_DA => X_DA,
      'L' => 'L',  X_CB => X_CB,  X_DB => X_DB,
      'M' => 'M',  X_CC => X_CC,  X_DC => X_DC,
      'N' => 'N',  X_CD => X_CD,  X_DD => X_DD,
      'O' => 'O',  X_CE => X_CE,  X_DE => X_DE,
      'P' => 'P',  X_CF => X_CF,  X_DF => X_DF,  X_FF => X_FF,
      'Q' => 'Q',  X_A6 => X_A6,
      'R' => 'R',  X_B4 => X_B4,
      'S' => 'S',  X_BC => X_BC,
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   --------------------------------------------
   -- Definitions for IBM PC (Code Page 437) --
   --------------------------------------------

   --  Note: Code page 437 is the typical default in Windows for PC's in the
   --  US, it corresponds to the original PC character set. See also the
   --  definitions for code page 850.

   Fold_IBM_PC_437 : constant Translate_Table := Translate_Table'(

      'a' => 'A',
      'b' => 'B',
      'c' => 'C',
      'd' => 'D',
      'e' => 'E',
      'f' => 'F',
      'g' => 'G',
      'h' => 'H',
      'i' => 'I',
      'j' => 'J',
      'k' => 'K',
      'l' => 'L',
      'm' => 'M',
      'n' => 'N',
      'o' => 'O',
      'p' => 'P',
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',
      'B' => 'B',
      'C' => 'C',
      'D' => 'D',
      'E' => 'E',
      'F' => 'F',
      'G' => 'G',
      'H' => 'H',
      'I' => 'I',
      'J' => 'J',
      'K' => 'K',
      'L' => 'L',
      'M' => 'M',
      'N' => 'N',
      'O' => 'O',
      'P' => 'P',
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      X_80 => X_80,  -- C cedilla
      X_81 => X_9A,  -- u umlaut
      X_82 => X_90,  -- e acute
      X_83 => X_83,  -- a circumflex
      X_84 => X_8E,  -- a umlaut
      X_85 => X_85,  -- a grave
      X_86 => X_8F,  -- a ring
      X_87 => X_80,  -- c cedilla
      X_88 => X_88,  -- e circumflex
      X_89 => X_89,  -- e umlaut
      X_8A => X_8A,  -- e grave
      X_8B => X_8B,  -- i umlaut
      X_8C => X_8C,  -- i circumflex
      X_8D => X_8D,  -- i grave
      X_8E => X_8E,  -- A umlaut
      X_8F => X_8F,  -- A ring

      X_90 => X_90,  -- E acute
      X_91 => X_92,  -- ae
      X_92 => X_92,  -- AE
      X_93 => X_93,  -- o circumflex
      X_94 => X_99,  -- o umlaut
      X_95 => X_95,  -- o grave
      X_96 => X_96,  -- u circumflex
      X_97 => X_97,  -- u grave
      X_98 => X_98,  -- y umlaut
      X_99 => X_99,  -- O umlaut
      X_9A => X_9A,  -- U umlaut

      X_A0 => X_A0,  -- a acute
      X_A1 => X_A1,  -- i acute
      X_A2 => X_A2,  -- o acute
      X_A3 => X_A3,  -- u acute
      X_A4 => X_A5,  -- n tilde
      X_A5 => X_A5,  -- N tilde
      X_A6 => X_A6,  -- a underline
      X_A7 => X_A7,  -- o underline

      X_E0 => X_E0,  -- lower case alpha
      X_E1 => X_E1,  -- lower case beta
      X_E2 => X_E2,  -- upper case gamma
      X_E3 => X_E3,  -- lower case pi
      X_E4 => X_E4,  -- upper case sigma (lower/upper sigma not equivalent)
      X_E5 => X_E5,  -- lower case sigma (lower/upper sigma not equivalent)
      X_E6 => X_E6,  -- lower case mu
      X_E7 => X_E7,  -- lower case tau
      X_E8 => X_E8,  -- upper case phi   (lower/upper phi not equivalent)
      X_E9 => X_E9,  -- lower case theta
      X_EA => X_EA,  -- upper case omega
      X_EB => X_EB,  -- lower case delta
      X_ED => X_ED,  -- lower case phi   (lower/upper phi not equivalent)
      X_EE => X_EE,  -- lower case epsilon

      X_FC => X_FC,  -- lower case eta

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   --------------------------------------------
   -- Definitions for IBM PC (Code Page 850) --
   --------------------------------------------

   --  Note: Code page 850 is the typical default in Windows for PC's in
   --  Europe, it is an extension of the original PC character set to include
   --  the additional characters defined in ISO Latin-1. See also the
   --  definitions for code page 437.

   Fold_IBM_PC_850 : constant Translate_Table := Translate_Table'(

      'a' => 'A',
      'b' => 'B',
      'c' => 'C',
      'd' => 'D',
      'e' => 'E',
      'f' => 'F',
      'g' => 'G',
      'h' => 'H',
      'i' => 'I',
      'j' => 'J',
      'k' => 'K',
      'l' => 'L',
      'm' => 'M',
      'n' => 'N',
      'o' => 'O',
      'p' => 'P',
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',
      'B' => 'B',
      'C' => 'C',
      'D' => 'D',
      'E' => 'E',
      'F' => 'F',
      'G' => 'G',
      'H' => 'H',
      'I' => 'I',
      'J' => 'J',
      'K' => 'K',
      'L' => 'L',
      'M' => 'M',
      'N' => 'N',
      'O' => 'O',
      'P' => 'P',
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      X_80 => X_80,  -- C cedilla
      X_81 => X_9A,  -- u umlaut
      X_82 => X_90,  -- e acute
      X_83 => X_B6,  -- a circumflex
      X_84 => X_8E,  -- a umlaut
      X_85 => X_B7,  -- a grave
      X_86 => X_8F,  -- a ring
      X_87 => X_80,  -- c cedilla
      X_88 => X_D2,  -- e circumflex
      X_89 => X_D3,  -- e umlaut
      X_8A => X_D4,  -- e grave
      X_8B => X_D8,  -- i umlaut
      X_8C => X_D7,  -- i circumflex
      X_8D => X_DE,  -- i grave
      X_8E => X_8E,  -- A umlaut
      X_8F => X_8F,  -- A ring

      X_90 => X_90,  -- E acute
      X_91 => X_92,  -- ae
      X_92 => X_92,  -- AE
      X_93 => X_E2,  -- o circumflex
      X_94 => X_99,  -- o umlaut
      X_95 => X_E3,  -- o grave
      X_96 => X_EA,  -- u circumflex
      X_97 => X_EB,  -- u grave
      X_98 => X_98,  -- y umlaut
      X_99 => X_99,  -- O umlaut
      X_9A => X_9A,  -- U umlaut

      X_A0 => X_B5,  -- a acute
      X_A1 => X_D6,  -- i acute
      X_A2 => X_E0,  -- o acute
      X_A3 => X_E9,  -- u acute
      X_A4 => X_A5,  -- n tilde
      X_A5 => X_A5,  -- N tilde
      X_A6 => X_A6,  -- a underline
      X_A7 => X_A7,  -- o underline

      X_B5 => X_B5,  -- A acute
      X_B6 => X_B6,  -- A circumflex
      X_B7 => X_B7,  -- A grave

      X_C6 => X_C7,  -- a tilde
      X_C7 => X_C7,  -- A tilde

      X_D0 => X_D1,  -- eth
      X_D1 => X_D1,  -- Eth
      X_D2 => X_D2,  -- E circumflex
      X_D3 => X_D3,  -- E umlaut
      X_D4 => X_D4,  -- E grave
      X_D5 => X_D5,  -- dotless i, no uppercase
      X_D6 => X_D6,  -- I acute
      X_D7 => X_D7,  -- I circumflex
      X_D8 => X_D8,  -- I umlaut
      X_DE => X_DE,  -- I grave

      X_E0 => X_E0,  -- O acute
      X_E1 => X_E1,  -- german dbl s, no uppercase
      X_E2 => X_E2,  -- O circumflex
      X_E3 => X_E3,  -- O grave
      X_E4 => X_E4,  -- o tilde
      X_E5 => X_E5,  -- O tilde
      X_E7 => X_E8,  -- thorn
      X_E8 => X_E8,  -- Thorn
      X_E9 => X_E9,  -- U acute
      X_EA => X_EA,  -- U circumflex
      X_EB => X_EB,  -- U grave
      X_EC => X_ED,  -- y acute
      X_ED => X_ED,  -- Y acute

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   -----------------------------------------
   -- Definitions for Full Upper Half Set --
   -----------------------------------------

   --  The full upper half set allows all upper half characters as letters,
   --  and does not recognize any upper/lower case equivalences in this half.

   Fold_Full_Upper_Half : constant Translate_Table := Translate_Table'(

      'a' => 'A',
      'b' => 'B',
      'c' => 'C',
      'd' => 'D',
      'e' => 'E',
      'f' => 'F',
      'g' => 'G',
      'h' => 'H',
      'i' => 'I',
      'j' => 'J',
      'k' => 'K',
      'l' => 'L',
      'm' => 'M',
      'n' => 'N',
      'o' => 'O',
      'p' => 'P',
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',
      'B' => 'B',
      'C' => 'C',
      'D' => 'D',
      'E' => 'E',
      'F' => 'F',
      'G' => 'G',
      'H' => 'H',
      'I' => 'I',
      'J' => 'J',
      'K' => 'K',
      'L' => 'L',
      'M' => 'M',
      'N' => 'N',
      'O' => 'O',
      'P' => 'P',
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      X_80 => X_80,  X_90 => X_90,  X_A0 => X_A0,  X_B0 => X_B0,
      X_81 => X_81,  X_91 => X_91,  X_A1 => X_A1,  X_B1 => X_B1,
      X_82 => X_82,  X_92 => X_92,  X_A2 => X_A2,  X_B2 => X_B2,
      X_83 => X_83,  X_93 => X_93,  X_A3 => X_A3,  X_B3 => X_B3,
      X_84 => X_84,  X_94 => X_94,  X_A4 => X_A4,  X_B4 => X_B4,
      X_85 => X_85,  X_95 => X_95,  X_A5 => X_A5,  X_B5 => X_B5,
      X_86 => X_86,  X_96 => X_96,  X_A6 => X_A6,  X_B6 => X_B6,
      X_87 => X_87,  X_97 => X_97,  X_A7 => X_A7,  X_B7 => X_B7,
      X_88 => X_88,  X_98 => X_98,  X_A8 => X_A8,  X_B8 => X_B8,
      X_89 => X_89,  X_99 => X_99,  X_A9 => X_A9,  X_B9 => X_B9,
      X_8A => X_8A,  X_9A => X_9A,  X_AA => X_AA,  X_BA => X_BA,
      X_8B => X_8B,  X_9B => X_9B,  X_AB => X_AB,  X_BB => X_BB,
      X_8C => X_8C,  X_9C => X_9C,  X_AC => X_AC,  X_BC => X_BC,
      X_8D => X_8D,  X_9D => X_9D,  X_AD => X_AD,  X_BD => X_BD,
      X_8E => X_8E,  X_9E => X_9E,  X_AE => X_AE,  X_BE => X_BE,
      X_8F => X_8F,  X_9F => X_9F,  X_AF => X_AF,  X_BF => X_BF,

      X_C0 => X_C0,  X_D0 => X_D0,  X_E0 => X_E0,  X_F0 => X_F0,
      X_C1 => X_C1,  X_D1 => X_D1,  X_E1 => X_E1,  X_F1 => X_F1,
      X_C2 => X_C2,  X_D2 => X_D2,  X_E2 => X_E2,  X_F2 => X_F2,
      X_C3 => X_C3,  X_D3 => X_D3,  X_E3 => X_E3,  X_F3 => X_F3,
      X_C4 => X_C4,  X_D4 => X_D4,  X_E4 => X_E4,  X_F4 => X_F4,
      X_C5 => X_C5,  X_D5 => X_D5,  X_E5 => X_E5,  X_F5 => X_F5,
      X_C6 => X_C6,  X_D6 => X_D6,  X_E6 => X_E6,  X_F6 => X_F6,
      X_C7 => X_C7,  X_D7 => X_D7,  X_E7 => X_E7,  X_F7 => X_F7,
      X_C8 => X_C8,  X_D8 => X_D8,  X_E8 => X_E8,  X_F8 => X_F8,
      X_C9 => X_C9,  X_D9 => X_D9,  X_E9 => X_E9,  X_F9 => X_F9,
      X_CA => X_CA,  X_DA => X_DA,  X_EA => X_EA,  X_FA => X_FA,
      X_CB => X_CB,  X_DB => X_DB,  X_EB => X_EB,  X_FB => X_FB,
      X_CC => X_CC,  X_DC => X_DC,  X_EC => X_EC,  X_FC => X_FC,
      X_CD => X_CD,  X_DD => X_DD,  X_ED => X_ED,  X_FD => X_FD,
      X_CE => X_CE,  X_DE => X_DE,  X_EE => X_EE,  X_FE => X_FE,
      X_CF => X_CF,  X_DF => X_DF,  X_EF => X_EF,  X_FF => X_FF,

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   ---------------------------------------
   -- Definitions for No Upper Half Set --
   ---------------------------------------

   --  The no upper half set allows no upper half characters as letters, and
   --  thus there are no upper/lower case equivalences in this half. This set
   --  corresponds to the Ada 83 rules.

   Fold_No_Upper_Half : constant Translate_Table := Translate_Table'(

      'a' => 'A',
      'b' => 'B',
      'c' => 'C',
      'd' => 'D',
      'e' => 'E',
      'f' => 'F',
      'g' => 'G',
      'h' => 'H',
      'i' => 'I',
      'j' => 'J',
      'k' => 'K',
      'l' => 'L',
      'm' => 'M',
      'n' => 'N',
      'o' => 'O',
      'p' => 'P',
      'q' => 'Q',
      'r' => 'R',
      's' => 'S',
      't' => 'T',
      'u' => 'U',
      'v' => 'V',
      'w' => 'W',
      'x' => 'X',
      'y' => 'Y',
      'z' => 'Z',

      'A' => 'A',
      'B' => 'B',
      'C' => 'C',
      'D' => 'D',
      'E' => 'E',
      'F' => 'F',
      'G' => 'G',
      'H' => 'H',
      'I' => 'I',
      'J' => 'J',
      'K' => 'K',
      'L' => 'L',
      'M' => 'M',
      'N' => 'N',
      'O' => 'O',
      'P' => 'P',
      'Q' => 'Q',
      'R' => 'R',
      'S' => 'S',
      'T' => 'T',
      'U' => 'U',
      'V' => 'V',
      'W' => 'W',
      'X' => 'X',
      'Y' => 'Y',
      'Z' => 'Z',

      '0' => '0',
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',

      '_' => '_',

      others => ' ');

   ----------------
   -- Initialize --
   ----------------

   procedure Initialize is
   begin
      --  Set Fold_Upper table from source code indication

      if Identifier_Character_Set = '1'
        or else Identifier_Character_Set = 'w'
      then
         Fold_Upper := Fold_Latin_1;

      elsif Identifier_Character_Set = '2' then
         Fold_Upper := Fold_Latin_2;

      elsif Identifier_Character_Set = '3' then
         Fold_Upper := Fold_Latin_3;

      elsif Identifier_Character_Set = '4' then
         Fold_Upper := Fold_Latin_4;

      elsif Identifier_Character_Set = '5' then
         Fold_Upper := Fold_Cyrillic;

      elsif Identifier_Character_Set = 'p' then
         Fold_Upper := Fold_IBM_PC_437;

      elsif Identifier_Character_Set = '8' then
         Fold_Upper := Fold_IBM_PC_850;

      elsif Identifier_Character_Set = '9' then
         Fold_Upper := Fold_Latin_9;

      elsif Identifier_Character_Set = 'f' then
         Fold_Upper := Fold_Full_Upper_Half;

      else -- Identifier_Character_Set = 'n'
         Fold_Upper := Fold_No_Upper_Half;
      end if;

      --  Use Fold_Upper table to compute Fold_Lower table

      Fold_Lower := Fold_Upper;

      for J in Character loop
         if J /= Fold_Upper (J) then
            Fold_Lower (Fold_Upper (J)) := J;
            Fold_Lower (J) := J;
         end if;
      end loop;

      Fold_Lower (' ') := ' ';

      --  Build Identifier_Char table from used entries of Fold_Upper

      for J in Character loop
         Identifier_Char (J) := (Fold_Upper (J) /= ' ');
      end loop;

      --  Always add [ as an identifier character to deal with the brackets
      --  notation for wide characters used in identifiers. Note that if
      --  we are not allowing wide characters in identifiers, then any use
      --  of this notation will be flagged as an error in Scan_Identifier.

      Identifier_Char ('[') := True;

      --  Add entry for ESC if wide characters in use with a wide character
      --  encoding method active that uses the ESC code for encoding.

      if Identifier_Character_Set = 'w'
        and then Wide_Character_Encoding_Method in WC_ESC_Encoding_Method
      then
         Identifier_Char (ASCII.ESC) := True;
      end if;
   end Initialize;

   --------------------------
   -- Is_Lower_Case_Letter --
   --------------------------

   function Is_Lower_Case_Letter (C : Character) return Boolean is
   begin
      return C /= Fold_Upper (C);
   end Is_Lower_Case_Letter;

   --------------------------
   -- Is_Upper_Case_Letter --
   --------------------------

   function Is_Upper_Case_Letter (C : Character) return Boolean is
   begin
      return C /= Fold_Lower (C);
   end Is_Upper_Case_Letter;

end Csets;