Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
38919 views
1
/*
2
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package sun.nio.cs.ext;
27
28
import java.lang.ref.SoftReference;
29
import java.nio.charset.Charset;
30
import java.nio.charset.spi.CharsetProvider;
31
import sun.nio.cs.AbstractCharsetProvider;
32
import java.security.AccessController;
33
import sun.security.action.GetPropertyAction;
34
35
36
/**
37
* Provider for extended charsets.
38
*/
39
40
public class ExtendedCharsets
41
extends AbstractCharsetProvider
42
{
43
44
static volatile ExtendedCharsets instance = null;
45
46
public ExtendedCharsets() {
47
48
super("sun.nio.cs.ext"); // identify provider pkg name.
49
50
// Traditional Chinese
51
52
charset("Big5", "Big5",
53
new String[] {
54
// IANA aliases
55
"csBig5"
56
});
57
58
charset("x-MS950-HKSCS-XP", "MS950_HKSCS_XP",
59
new String[] {
60
"MS950_HKSCS_XP" // JDK historical;
61
});
62
63
charset("x-MS950-HKSCS", "MS950_HKSCS",
64
new String[] {
65
// IANA aliases
66
"MS950_HKSCS" // JDK historical;
67
});
68
69
charset("x-windows-950", "MS950",
70
new String[] {
71
"ms950", // JDK historical
72
"windows-950"
73
});
74
75
charset("x-windows-874", "MS874",
76
new String[] {
77
"ms874", // JDK historical
78
"ms-874",
79
"windows-874" });
80
81
charset("x-EUC-TW", "EUC_TW",
82
new String[] {
83
"euc_tw", // JDK historical
84
"euctw",
85
"cns11643",
86
"EUC-TW"
87
});
88
89
charset("Big5-HKSCS", "Big5_HKSCS",
90
new String[] {
91
"Big5_HKSCS", // JDK historical
92
"big5hk",
93
"big5-hkscs",
94
"big5hkscs" // Linux alias
95
});
96
97
charset("x-Big5-HKSCS-2001", "Big5_HKSCS_2001",
98
new String[] {
99
"Big5_HKSCS_2001",
100
"big5hk-2001",
101
"big5-hkscs-2001",
102
"big5-hkscs:unicode3.0",
103
"big5hkscs-2001",
104
});
105
106
charset("x-Big5-Solaris", "Big5_Solaris",
107
new String[] {
108
"Big5_Solaris", // JDK historical
109
});
110
111
// Simplified Chinese
112
charset("GBK", "GBK",
113
new String[] {
114
"windows-936",
115
"CP936"
116
});
117
118
charset("GB18030", "GB18030",
119
new String[] {
120
"gb18030-2000"
121
});
122
123
charset("GB2312", "EUC_CN",
124
new String[] {
125
// IANA aliases
126
"gb2312",
127
"gb2312-80",
128
"gb2312-1980",
129
"euc-cn",
130
"euccn",
131
"x-EUC-CN", // 1.4 compatibility
132
"EUC_CN" //JDK historical
133
});
134
135
charset("x-mswin-936", "MS936",
136
new String[] {
137
"ms936", // historical
138
// IANA aliases
139
"ms_936"
140
});
141
142
// The definition of this charset may be overridden by the init method,
143
// below, if the sun.nio.cs.map property is defined.
144
//
145
charset("Shift_JIS", "SJIS",
146
new String[] {
147
// IANA aliases
148
"sjis", // historical
149
"shift_jis",
150
"shift-jis",
151
"ms_kanji",
152
"x-sjis",
153
"csShiftJIS"
154
});
155
156
// The definition of this charset may be overridden by the init method,
157
// below, if the sun.nio.cs.map property is defined.
158
//
159
charset("windows-31j", "MS932",
160
new String[] {
161
"MS932", // JDK historical
162
"windows-932",
163
"csWindows31J"
164
});
165
166
charset("JIS_X0201", "JIS_X_0201",
167
new String[] {
168
"JIS0201", // JDK historical
169
// IANA aliases
170
"JIS_X0201",
171
"X0201",
172
"csHalfWidthKatakana"
173
});
174
175
charset("x-JIS0208", "JIS_X_0208",
176
new String[] {
177
"JIS0208", // JDK historical
178
// IANA aliases
179
"JIS_C6226-1983",
180
"iso-ir-87",
181
"x0208",
182
"JIS_X0208-1983",
183
"csISO87JISX0208"
184
});
185
186
charset("JIS_X0212-1990", "JIS_X_0212",
187
new String[] {
188
"JIS0212", // JDK historical
189
// IANA aliases
190
"jis_x0212-1990",
191
"x0212",
192
"iso-ir-159",
193
"csISO159JISX02121990"
194
});
195
196
charset("x-SJIS_0213", "SJIS_0213",
197
new String[] {
198
"sjis-0213",
199
"sjis_0213",
200
"sjis:2004",
201
"sjis_0213:2004",
202
"shift_jis_0213:2004",
203
"shift_jis:2004"
204
});
205
206
charset("x-MS932_0213", "MS932_0213",
207
new String[] {
208
"MS932-0213",
209
"MS932_0213",
210
"MS932:2004",
211
"windows-932-0213",
212
"windows-932:2004"
213
});
214
215
charset("EUC-JP", "EUC_JP",
216
new String[] {
217
"euc_jp", // JDK historical
218
// IANA aliases
219
"eucjis",
220
"eucjp",
221
"Extended_UNIX_Code_Packed_Format_for_Japanese",
222
"csEUCPkdFmtjapanese",
223
"x-euc-jp",
224
"x-eucjp"
225
});
226
227
charset("x-euc-jp-linux", "EUC_JP_LINUX",
228
new String[] {
229
"euc_jp_linux", // JDK historical
230
"euc-jp-linux"
231
});
232
233
charset("x-eucjp-open", "EUC_JP_Open",
234
new String[] {
235
"EUC_JP_Solaris", // JDK historical
236
"eucJP-open"
237
});
238
239
charset("x-PCK", "PCK",
240
new String[] {
241
// IANA aliases
242
"pck" // historical
243
});
244
245
charset("ISO-2022-JP", "ISO2022_JP",
246
new String[] {
247
// IANA aliases
248
"iso2022jp", // historical
249
"jis",
250
"csISO2022JP",
251
"jis_encoding",
252
"csjisencoding"
253
});
254
255
charset("ISO-2022-JP-2", "ISO2022_JP_2",
256
new String[] {
257
// IANA aliases
258
"csISO2022JP2",
259
"iso2022jp2"
260
});
261
262
charset("x-windows-50221", "MS50221",
263
new String[] {
264
"ms50221", // historical
265
"cp50221",
266
});
267
268
charset("x-windows-50220", "MS50220",
269
new String[] {
270
"ms50220", // historical
271
"cp50220",
272
});
273
274
charset("x-windows-iso2022jp", "MSISO2022JP",
275
new String[] {
276
"windows-iso2022jp", // historical
277
});
278
279
charset("x-JISAutoDetect", "JISAutoDetect",
280
new String[] {
281
"JISAutoDetect" // historical
282
});
283
284
// Korean
285
charset("EUC-KR", "EUC_KR",
286
new String[] {
287
"euc_kr", // JDK historical
288
// IANA aliases
289
"ksc5601",
290
"euckr",
291
"ks_c_5601-1987",
292
"ksc5601-1987",
293
"ksc5601_1987",
294
"ksc_5601",
295
"csEUCKR",
296
"5601"
297
});
298
299
charset("x-windows-949", "MS949",
300
new String[] {
301
"ms949", // JDK historical
302
"windows949",
303
"windows-949",
304
// IANA aliases
305
"ms_949"
306
});
307
308
charset("x-Johab", "Johab",
309
new String[] {
310
"ksc5601-1992",
311
"ksc5601_1992",
312
"ms1361",
313
"johab" // JDK historical
314
});
315
316
charset("ISO-2022-KR", "ISO2022_KR",
317
new String[] {
318
"ISO2022KR", // JDK historical
319
"csISO2022KR"
320
});
321
322
charset("ISO-2022-CN", "ISO2022_CN",
323
new String[] {
324
"ISO2022CN", // JDK historical
325
"csISO2022CN"
326
});
327
328
charset("x-ISO-2022-CN-CNS", "ISO2022_CN_CNS",
329
new String[] {
330
"ISO2022CN_CNS", // JDK historical
331
"ISO-2022-CN-CNS"
332
});
333
334
charset("x-ISO-2022-CN-GB", "ISO2022_CN_GB",
335
new String[] {
336
"ISO2022CN_GB", // JDK historical
337
"ISO-2022-CN-GB"
338
});
339
340
charset("x-ISCII91", "ISCII91",
341
new String[] {
342
"iscii",
343
"ST_SEV_358-88",
344
"iso-ir-153",
345
"csISO153GOST1976874",
346
"ISCII91" // JDK historical
347
});
348
349
charset("ISO-8859-3", "ISO_8859_3",
350
new String[] {
351
"iso8859_3", // JDK historical
352
"8859_3",
353
"ISO_8859-3:1988",
354
"iso-ir-109",
355
"ISO_8859-3",
356
"ISO8859-3",
357
"latin3",
358
"l3",
359
"ibm913",
360
"ibm-913",
361
"cp913",
362
"913",
363
"csISOLatin3"
364
});
365
366
charset("ISO-8859-6", "ISO_8859_6",
367
new String[] {
368
"iso8859_6", // JDK historical
369
"8859_6",
370
"iso-ir-127",
371
"ISO_8859-6",
372
"ISO_8859-6:1987",
373
"ISO8859-6",
374
"ECMA-114",
375
"ASMO-708",
376
"arabic",
377
"ibm1089",
378
"ibm-1089",
379
"cp1089",
380
"1089",
381
"csISOLatinArabic"
382
});
383
384
charset("ISO-8859-8", "ISO_8859_8",
385
new String[] {
386
"iso8859_8", // JDK historical
387
"8859_8",
388
"iso-ir-138",
389
"ISO_8859-8",
390
"ISO_8859-8:1988",
391
"ISO8859-8",
392
"cp916",
393
"916",
394
"ibm916",
395
"ibm-916",
396
"hebrew",
397
"csISOLatinHebrew"
398
});
399
400
charset("x-ISO-8859-11", "ISO_8859_11",
401
new String[] {
402
"iso-8859-11",
403
"iso8859_11"
404
});
405
406
charset("TIS-620", "TIS_620",
407
new String[] {
408
"tis620", // JDK historical
409
"tis620.2533"
410
});
411
412
// Various Microsoft Windows international codepages
413
414
charset("windows-1255", "MS1255",
415
new String[] {
416
"cp1255" // JDK historical
417
});
418
419
charset("windows-1256", "MS1256",
420
new String[] {
421
"cp1256" // JDK historical
422
});
423
424
charset("windows-1258", "MS1258",
425
new String[] {
426
"cp1258" // JDK historical
427
});
428
429
// IBM & PC/MSDOS encodings
430
431
charset("x-IBM942", "IBM942",
432
new String[] {
433
"cp942", // JDK historical
434
"ibm942",
435
"ibm-942",
436
"942"
437
});
438
439
charset("x-IBM942C", "IBM942C",
440
new String[] {
441
"cp942C", // JDK historical
442
"ibm942C",
443
"ibm-942C",
444
"942C"
445
});
446
447
charset("x-IBM943", "IBM943",
448
new String[] {
449
"cp943", // JDK historical
450
"ibm943",
451
"ibm-943",
452
"943"
453
});
454
455
charset("x-IBM943C", "IBM943C",
456
new String[] {
457
"cp943C", // JDK historical
458
"ibm943C",
459
"ibm-943C",
460
"943C"
461
});
462
463
charset("x-IBM948", "IBM948",
464
new String[] {
465
"cp948", // JDK historical
466
"ibm948",
467
"ibm-948",
468
"948"
469
});
470
471
charset("x-IBM950", "IBM950",
472
new String[] {
473
"cp950", // JDK historical
474
"ibm950",
475
"ibm-950",
476
"950"
477
});
478
479
charset("x-IBM930", "IBM930",
480
new String[] {
481
"cp930", // JDK historical
482
"ibm930",
483
"ibm-930",
484
"930"
485
});
486
487
charset("x-IBM935", "IBM935",
488
new String[] {
489
"cp935", // JDK historical
490
"ibm935",
491
"ibm-935",
492
"935"
493
});
494
495
charset("x-IBM937", "IBM937",
496
new String[] {
497
"cp937", // JDK historical
498
"ibm937",
499
"ibm-937",
500
"937"
501
});
502
503
charset("x-IBM856", "IBM856",
504
new String[] {
505
"cp856", // JDK historical
506
"ibm-856",
507
"ibm856",
508
"856"
509
});
510
511
charset("IBM860", "IBM860",
512
new String[] {
513
"cp860", // JDK historical
514
"ibm860",
515
"ibm-860",
516
"860",
517
"csIBM860"
518
});
519
charset("IBM861", "IBM861",
520
new String[] {
521
"cp861", // JDK historical
522
"ibm861",
523
"ibm-861",
524
"861",
525
"csIBM861",
526
"cp-is"
527
});
528
529
charset("IBM863", "IBM863",
530
new String[] {
531
"cp863", // JDK historical
532
"ibm863",
533
"ibm-863",
534
"863",
535
"csIBM863"
536
});
537
538
charset("IBM864", "IBM864",
539
new String[] {
540
"cp864", // JDK historical
541
"ibm864",
542
"ibm-864",
543
"864",
544
"csIBM864"
545
});
546
547
charset("IBM865", "IBM865",
548
new String[] {
549
"cp865", // JDK historical
550
"ibm865",
551
"ibm-865",
552
"865",
553
"csIBM865"
554
});
555
556
charset("IBM868", "IBM868",
557
new String[] {
558
"cp868", // JDK historical
559
"ibm868",
560
"ibm-868",
561
"868",
562
"cp-ar",
563
"csIBM868"
564
});
565
566
charset("IBM869", "IBM869",
567
new String[] {
568
"cp869", // JDK historical
569
"ibm869",
570
"ibm-869",
571
"869",
572
"cp-gr",
573
"csIBM869"
574
});
575
576
charset("x-IBM921", "IBM921",
577
new String[] {
578
"cp921", // JDK historical
579
"ibm921",
580
"ibm-921",
581
"921"
582
});
583
584
charset("x-IBM1006", "IBM1006",
585
new String[] {
586
"cp1006", // JDK historical
587
"ibm1006",
588
"ibm-1006",
589
"1006"
590
});
591
592
charset("x-IBM1046", "IBM1046",
593
new String[] {
594
"cp1046", // JDK historical
595
"ibm1046",
596
"ibm-1046",
597
"1046"
598
});
599
600
charset("IBM1047", "IBM1047",
601
new String[] {
602
"cp1047", // JDK historical
603
"ibm-1047",
604
"1047"
605
});
606
607
charset("x-IBM1098", "IBM1098",
608
new String[] {
609
"cp1098", // JDK historical
610
"ibm1098",
611
"ibm-1098",
612
"1098",
613
});
614
615
charset("IBM037", "IBM037",
616
new String[] {
617
"cp037", // JDK historical
618
"ibm037",
619
"ebcdic-cp-us",
620
"ebcdic-cp-ca",
621
"ebcdic-cp-wt",
622
"ebcdic-cp-nl",
623
"csIBM037",
624
"cs-ebcdic-cp-us",
625
"cs-ebcdic-cp-ca",
626
"cs-ebcdic-cp-wt",
627
"cs-ebcdic-cp-nl",
628
"ibm-037",
629
"ibm-37",
630
"cpibm37",
631
"037"
632
});
633
634
charset("x-IBM1025", "IBM1025",
635
new String[] {
636
"cp1025", // JDK historical
637
"ibm1025",
638
"ibm-1025",
639
"1025"
640
});
641
642
charset("IBM1026", "IBM1026",
643
new String[] {
644
"cp1026", // JDK historical
645
"ibm1026",
646
"ibm-1026",
647
"1026"
648
});
649
650
charset("x-IBM1112", "IBM1112",
651
new String[] {
652
"cp1112", // JDK historical
653
"ibm1112",
654
"ibm-1112",
655
"1112"
656
});
657
658
charset("x-IBM1122", "IBM1122",
659
new String[] {
660
"cp1122", // JDK historical
661
"ibm1122",
662
"ibm-1122",
663
"1122"
664
});
665
666
charset("x-IBM1123", "IBM1123",
667
new String[] {
668
"cp1123", // JDK historical
669
"ibm1123",
670
"ibm-1123",
671
"1123"
672
});
673
674
charset("x-IBM1124", "IBM1124",
675
new String[] {
676
"cp1124", // JDK historical
677
"ibm1124",
678
"ibm-1124",
679
"1124"
680
});
681
682
charset("x-IBM1364", "IBM1364",
683
new String[] {
684
"cp1364",
685
"ibm1364",
686
"ibm-1364",
687
"1364"
688
});
689
690
charset("IBM273", "IBM273",
691
new String[] {
692
"cp273", // JDK historical
693
"ibm273",
694
"ibm-273",
695
"273"
696
});
697
698
charset("IBM277", "IBM277",
699
new String[] {
700
"cp277", // JDK historical
701
"ibm277",
702
"ibm-277",
703
"277"
704
});
705
706
charset("IBM278", "IBM278",
707
new String[] {
708
"cp278", // JDK historical
709
"ibm278",
710
"ibm-278",
711
"278",
712
"ebcdic-sv",
713
"ebcdic-cp-se",
714
"csIBM278"
715
});
716
717
charset("IBM280", "IBM280",
718
new String[] {
719
"cp280", // JDK historical
720
"ibm280",
721
"ibm-280",
722
"280"
723
});
724
725
charset("IBM284", "IBM284",
726
new String[] {
727
"cp284", // JDK historical
728
"ibm284",
729
"ibm-284",
730
"284",
731
"csIBM284",
732
"cpibm284"
733
});
734
735
charset("IBM285", "IBM285",
736
new String[] {
737
"cp285", // JDK historical
738
"ibm285",
739
"ibm-285",
740
"285",
741
"ebcdic-cp-gb",
742
"ebcdic-gb",
743
"csIBM285",
744
"cpibm285"
745
});
746
747
charset("IBM297", "IBM297",
748
new String[] {
749
"cp297", // JDK historical
750
"ibm297",
751
"ibm-297",
752
"297",
753
"ebcdic-cp-fr",
754
"cpibm297",
755
"csIBM297",
756
});
757
758
charset("IBM420", "IBM420",
759
new String[] {
760
"cp420", // JDK historical
761
"ibm420",
762
"ibm-420",
763
"ebcdic-cp-ar1",
764
"420",
765
"csIBM420"
766
});
767
768
charset("IBM424", "IBM424",
769
new String[] {
770
"cp424", // JDK historical
771
"ibm424",
772
"ibm-424",
773
"424",
774
"ebcdic-cp-he",
775
"csIBM424"
776
});
777
778
charset("IBM500", "IBM500",
779
new String[] {
780
"cp500", // JDK historical
781
"ibm500",
782
"ibm-500",
783
"500",
784
"ebcdic-cp-ch",
785
"ebcdic-cp-bh",
786
"csIBM500"
787
});
788
789
charset("x-IBM833", "IBM833",
790
new String[] {
791
"cp833",
792
"ibm833",
793
"ibm-833"
794
});
795
796
//EBCDIC DBCS-only Korean
797
charset("x-IBM834", "IBM834",
798
new String[] {
799
"cp834",
800
"ibm834",
801
"834",
802
"ibm-834"
803
});
804
805
806
charset("IBM-Thai", "IBM838",
807
new String[] {
808
"cp838", // JDK historical
809
"ibm838",
810
"ibm-838",
811
"838"
812
});
813
814
charset("IBM870", "IBM870",
815
new String[] {
816
"cp870", // JDK historical
817
"ibm870",
818
"ibm-870",
819
"870",
820
"ebcdic-cp-roece",
821
"ebcdic-cp-yu",
822
"csIBM870"
823
});
824
825
charset("IBM871", "IBM871",
826
new String[] {
827
"cp871", // JDK historical
828
"ibm871",
829
"ibm-871",
830
"871",
831
"ebcdic-cp-is",
832
"csIBM871"
833
});
834
835
charset("x-IBM875", "IBM875",
836
new String[] {
837
"cp875", // JDK historical
838
"ibm875",
839
"ibm-875",
840
"875"
841
});
842
843
charset("IBM918", "IBM918",
844
new String[] {
845
"cp918", // JDK historical
846
"ibm-918",
847
"918",
848
"ebcdic-cp-ar2"
849
});
850
851
charset("x-IBM922", "IBM922",
852
new String[] {
853
"cp922", // JDK historical
854
"ibm922",
855
"ibm-922",
856
"922"
857
});
858
859
charset("x-IBM1097", "IBM1097",
860
new String[] {
861
"cp1097", // JDK historical
862
"ibm1097",
863
"ibm-1097",
864
"1097"
865
});
866
867
charset("x-IBM949", "IBM949",
868
new String[] {
869
"cp949", // JDK historical
870
"ibm949",
871
"ibm-949",
872
"949"
873
});
874
875
charset("x-IBM949C", "IBM949C",
876
new String[] {
877
"cp949C", // JDK historical
878
"ibm949C",
879
"ibm-949C",
880
"949C"
881
});
882
883
charset("x-IBM939", "IBM939",
884
new String[] {
885
"cp939", // JDK historical
886
"ibm939",
887
"ibm-939",
888
"939"
889
});
890
891
charset("x-IBM933", "IBM933",
892
new String[] {
893
"cp933", // JDK historical
894
"ibm933",
895
"ibm-933",
896
"933"
897
});
898
899
charset("x-IBM1381", "IBM1381",
900
new String[] {
901
"cp1381", // JDK historical
902
"ibm1381",
903
"ibm-1381",
904
"1381"
905
});
906
907
charset("x-IBM1383", "IBM1383",
908
new String[] {
909
"cp1383", // JDK historical
910
"ibm1383",
911
"ibm-1383",
912
"1383"
913
});
914
915
charset("x-IBM970", "IBM970",
916
new String[] {
917
"cp970", // JDK historical
918
"ibm970",
919
"ibm-970",
920
"ibm-eucKR",
921
"970"
922
});
923
924
charset("x-IBM964", "IBM964",
925
new String[] {
926
"cp964", // JDK historical
927
"ibm964",
928
"ibm-964",
929
"964"
930
});
931
932
charset("x-IBM33722", "IBM33722",
933
new String[] {
934
"cp33722", // JDK historical
935
"ibm33722",
936
"ibm-33722",
937
"ibm-5050", // from IBM alias list
938
"ibm-33722_vascii_vpua", // from IBM alias list
939
"33722"
940
});
941
942
charset("IBM01140", "IBM1140",
943
new String[] {
944
"cp1140", // JDK historical
945
"ccsid01140",
946
"cp01140",
947
"1140",
948
"ebcdic-us-037+euro"
949
});
950
951
charset("IBM01141", "IBM1141",
952
new String[] {
953
"cp1141", // JDK historical
954
"ccsid01141",
955
"cp01141",
956
"1141",
957
"ebcdic-de-273+euro"
958
});
959
960
charset("IBM01142", "IBM1142",
961
new String[] {
962
"cp1142", // JDK historical
963
"ccsid01142",
964
"cp01142",
965
"1142",
966
"ebcdic-no-277+euro",
967
"ebcdic-dk-277+euro"
968
});
969
970
charset("IBM01143", "IBM1143",
971
new String[] {
972
"cp1143", // JDK historical
973
"ccsid01143",
974
"cp01143",
975
"1143",
976
"ebcdic-fi-278+euro",
977
"ebcdic-se-278+euro"
978
});
979
980
charset("IBM01144", "IBM1144",
981
new String[] {
982
"cp1144", // JDK historical
983
"ccsid01144",
984
"cp01144",
985
"1144",
986
"ebcdic-it-280+euro"
987
});
988
989
charset("IBM01145", "IBM1145",
990
new String[] {
991
"cp1145", // JDK historical
992
"ccsid01145",
993
"cp01145",
994
"1145",
995
"ebcdic-es-284+euro"
996
});
997
998
charset("IBM01146", "IBM1146",
999
new String[] {
1000
"cp1146", // JDK historical
1001
"ccsid01146",
1002
"cp01146",
1003
"1146",
1004
"ebcdic-gb-285+euro"
1005
});
1006
1007
charset("IBM01147", "IBM1147",
1008
new String[] {
1009
"cp1147", // JDK historical
1010
"ccsid01147",
1011
"cp01147",
1012
"1147",
1013
"ebcdic-fr-277+euro"
1014
});
1015
1016
charset("IBM01148", "IBM1148",
1017
new String[] {
1018
"cp1148", // JDK historical
1019
"ccsid01148",
1020
"cp01148",
1021
"1148",
1022
"ebcdic-international-500+euro"
1023
});
1024
1025
charset("IBM01149", "IBM1149",
1026
new String[] {
1027
"cp1149", // JDK historical
1028
"ccsid01149",
1029
"cp01149",
1030
"1149",
1031
"ebcdic-s-871+euro"
1032
});
1033
1034
charset("x-IBM1166", "IBM1166",
1035
new String[] {
1036
"cp1166", // JDK historical
1037
"ibm1166",
1038
"ibm-1166",
1039
"1166"
1040
});
1041
1042
charset("IBM290", "IBM290",
1043
new String[] {
1044
"cp290",
1045
"ibm290",
1046
"ibm-290",
1047
"csIBM290",
1048
"EBCDIC-JP-kana",
1049
"290"
1050
});
1051
1052
charset("x-IBM300", "IBM300",
1053
new String[] {
1054
"cp300",
1055
"ibm300",
1056
"ibm-300",
1057
"300"
1058
});
1059
1060
// Macintosh MacOS/Apple char encodingd
1061
1062
1063
charset("x-MacRoman", "MacRoman",
1064
new String[] {
1065
"MacRoman" // JDK historical
1066
});
1067
1068
charset("x-MacCentralEurope", "MacCentralEurope",
1069
new String[] {
1070
"MacCentralEurope" // JDK historical
1071
});
1072
1073
charset("x-MacCroatian", "MacCroatian",
1074
new String[] {
1075
"MacCroatian" // JDK historical
1076
});
1077
1078
1079
charset("x-MacGreek", "MacGreek",
1080
new String[] {
1081
"MacGreek" // JDK historical
1082
});
1083
1084
charset("x-MacCyrillic", "MacCyrillic",
1085
new String[] {
1086
"MacCyrillic" // JDK historical
1087
});
1088
1089
charset("x-MacUkraine", "MacUkraine",
1090
new String[] {
1091
"MacUkraine" // JDK historical
1092
});
1093
1094
charset("x-MacTurkish", "MacTurkish",
1095
new String[] {
1096
"MacTurkish" // JDK historical
1097
});
1098
1099
charset("x-MacArabic", "MacArabic",
1100
new String[] {
1101
"MacArabic" // JDK historical
1102
});
1103
1104
charset("x-MacHebrew", "MacHebrew",
1105
new String[] {
1106
"MacHebrew" // JDK historical
1107
});
1108
1109
charset("x-MacIceland", "MacIceland",
1110
new String[] {
1111
"MacIceland" // JDK historical
1112
});
1113
1114
charset("x-MacRomania", "MacRomania",
1115
new String[] {
1116
"MacRomania" // JDK historical
1117
});
1118
1119
charset("x-MacThai", "MacThai",
1120
new String[] {
1121
"MacThai" // JDK historical
1122
});
1123
1124
charset("x-MacSymbol", "MacSymbol",
1125
new String[] {
1126
"MacSymbol" // JDK historical
1127
});
1128
1129
charset("x-MacDingbat", "MacDingbat",
1130
new String[] {
1131
"MacDingbat" // JDK historical
1132
});
1133
1134
instance = this;
1135
1136
}
1137
1138
private boolean initialized = false;
1139
1140
// If the sun.nio.cs.map property is defined on the command line we won't
1141
// see it in the system-properties table until after the charset subsystem
1142
// has been initialized. We therefore delay the effect of this property
1143
// until after the JRE has completely booted.
1144
//
1145
// At the moment following values for this property are supported, property
1146
// value string is case insensitive.
1147
//
1148
// (1)"Windows-31J/Shift_JIS"
1149
// In 1.4.1 we added a correct implementation of the Shift_JIS charset
1150
// but in previous releases this charset name had been treated as an alias
1151
// for Windows-31J, aka MS932. Users who have existing code that depends
1152
// upon this alias can restore the previous behavior by defining this
1153
// property to have this value.
1154
//
1155
// (2)"x-windows-50221/ISO-2022-JP"
1156
// "x-windows-50220/ISO-2022-JP"
1157
// "x-windows-iso2022jp/ISO-2022-JP"
1158
// The charset ISO-2022-JP is a "standard based" implementation by default,
1159
// which supports ASCII, JIS_X_0201 and JIS_X_0208 mappings based encoding
1160
// and decoding only.
1161
// There are three Microsoft iso-2022-jp variants, namely x-windows-50220,
1162
// x-windows-50221 and x-windows-iso2022jp which behaves "slightly" differently
1163
// compared to the "standard based" implementation. See ISO2022_JP.java for
1164
// detailed description. Users who prefer the behavior of MS iso-2022-jp
1165
// variants should use these names explicitly instead of using "ISO-2022-JP"
1166
// and its aliases. However for those who need the ISO-2022-JP charset behaves
1167
// exactly the same as MS variants do, above properties can be defined to
1168
// switch.
1169
//
1170
// If we need to define other charset-alias mappings in the future then
1171
// this property could be further extended, the general idea being that its
1172
// value should be of the form
1173
//
1174
// new-charset-1/old-charset-1,new-charset-2/old-charset-2,...
1175
//
1176
// where each charset named to the left of a slash is intended to replace
1177
// (most) uses of the charset named to the right of the slash.
1178
//
1179
protected void init() {
1180
if (initialized)
1181
return;
1182
if (!sun.misc.VM.isBooted())
1183
return;
1184
1185
String map = AccessController.doPrivileged(
1186
new GetPropertyAction("sun.nio.cs.map"));
1187
boolean sjisIsMS932 = false;
1188
boolean iso2022jpIsMS50221 = false;
1189
boolean iso2022jpIsMS50220 = false;
1190
boolean iso2022jpIsMSISO2022JP = false;
1191
if (map != null) {
1192
String[] maps = map.split(",");
1193
for (int i = 0; i < maps.length; i++) {
1194
if (maps[i].equalsIgnoreCase("Windows-31J/Shift_JIS")) {
1195
sjisIsMS932 = true;
1196
} else if (maps[i].equalsIgnoreCase("x-windows-50221/ISO-2022-JP")) {
1197
iso2022jpIsMS50221 = true;
1198
} else if (maps[i].equalsIgnoreCase("x-windows-50220/ISO-2022-JP")) {
1199
iso2022jpIsMS50220 = true;
1200
} else if (maps[i].equalsIgnoreCase("x-windows-iso2022jp/ISO-2022-JP")) {
1201
iso2022jpIsMSISO2022JP = true;
1202
}
1203
}
1204
}
1205
if (sjisIsMS932) {
1206
deleteCharset("Shift_JIS",
1207
new String[] {
1208
// IANA aliases
1209
"sjis", // historical
1210
"shift_jis",
1211
"shift-jis",
1212
"ms_kanji",
1213
"x-sjis",
1214
"csShiftJIS"
1215
});
1216
deleteCharset("windows-31j",
1217
new String[] {
1218
"MS932", // JDK historical
1219
"windows-932",
1220
"csWindows31J"
1221
});
1222
charset("Shift_JIS", "SJIS",
1223
new String[] {
1224
// IANA aliases
1225
"sjis" // JDK historical
1226
});
1227
charset("windows-31j", "MS932",
1228
new String[] {
1229
"MS932", // JDK historical
1230
"windows-932",
1231
"csWindows31J",
1232
"shift-jis",
1233
"ms_kanji",
1234
"x-sjis",
1235
"csShiftJIS",
1236
// This alias takes precedence over the actual
1237
// Shift_JIS charset itself since aliases are always
1238
// resolved first, before looking up canonical names.
1239
"shift_jis"
1240
});
1241
}
1242
if (iso2022jpIsMS50221 ||
1243
iso2022jpIsMS50220 ||
1244
iso2022jpIsMSISO2022JP) {
1245
deleteCharset("ISO-2022-JP",
1246
new String[] {
1247
"iso2022jp",
1248
"jis",
1249
"csISO2022JP",
1250
"jis_encoding",
1251
"csjisencoding"
1252
});
1253
if (iso2022jpIsMS50221) {
1254
deleteCharset("x-windows-50221",
1255
new String[] {
1256
"cp50221",
1257
"ms50221"
1258
});
1259
charset("x-windows-50221", "MS50221",
1260
new String[] {
1261
"cp50221",
1262
"ms50221",
1263
"iso-2022-jp",
1264
"iso2022jp",
1265
"jis",
1266
"csISO2022JP",
1267
"jis_encoding",
1268
"csjisencoding"
1269
});
1270
} else if (iso2022jpIsMS50220) {
1271
deleteCharset("x-windows-50220",
1272
new String[] {
1273
"cp50220",
1274
"ms50220"
1275
});
1276
charset("x-windows-50220", "MS50220",
1277
new String[] {
1278
"cp50220",
1279
"ms50220",
1280
"iso-2022-jp",
1281
"iso2022jp",
1282
"jis",
1283
"csISO2022JP",
1284
"jis_encoding",
1285
"csjisencoding"
1286
});
1287
} else {
1288
deleteCharset("x-windows-iso2022jp",
1289
new String[] {
1290
"windows-iso2022jp"
1291
});
1292
charset("x-windows-iso2022jp", "MSISO2022JP",
1293
new String[] {
1294
"windows-iso2022jp",
1295
"iso-2022-jp",
1296
"iso2022jp",
1297
"jis",
1298
"csISO2022JP",
1299
"jis_encoding",
1300
"csjisencoding"
1301
});
1302
1303
1304
}
1305
}
1306
String osName = AccessController.doPrivileged(
1307
new GetPropertyAction("os.name"));
1308
if ("SunOS".equals(osName) || "Linux".equals(osName) || "AIX".equals(osName)
1309
|| osName.contains("OS X")) {
1310
charset("x-COMPOUND_TEXT", "COMPOUND_TEXT",
1311
new String[] {
1312
"COMPOUND_TEXT", // JDK historical
1313
"x11-compound_text",
1314
"x-compound-text"
1315
});
1316
}
1317
initialized = true;
1318
}
1319
1320
public static String[] aliasesFor(String charsetName) {
1321
if (instance == null)
1322
return null;
1323
return instance.aliases(charsetName);
1324
}
1325
}
1326
1327