2 // I18N.CJK.Gb2312Convert
5 // Alan Tam Siu Lung (Tam@SiuLung.com)
6 // Dick Porter (dick@ximian.com)
13 internal sealed class Gb2312Convert
15 public byte[] gb2312_to_unicode
;
16 public byte[] gb2312_from_unicode1
;
17 public byte[] gb2312_from_unicode2
;
18 public byte[] gb2312_from_unicode3
;
19 public byte[] gb2312_from_unicode4
;
20 public byte[] gb2312_from_unicode5
;
21 public byte[] gb2312_from_unicode6
;
22 public byte[] gb2312_from_unicode7
;
23 public byte[] gb2312_from_unicode8
;
24 public byte[] gb2312_from_unicode9
;
26 private Gb2312Convert()
28 using (CodeTable table
= new CodeTable ("gb2312.table")) {
29 gb2312_to_unicode
= table
.GetSection (1);
31 gb2312_from_unicode1
= table
.GetSection (2);
32 gb2312_from_unicode2
= table
.GetSection (3);
33 gb2312_from_unicode3
= table
.GetSection (4);
34 gb2312_from_unicode4
= table
.GetSection (5);
35 gb2312_from_unicode5
= table
.GetSection (6);
36 gb2312_from_unicode6
= table
.GetSection (7);
37 gb2312_from_unicode7
= table
.GetSection (8);
38 gb2312_from_unicode8
= table
.GetSection (9);
39 gb2312_from_unicode9
= table
.GetSection (10);
44 // The one and only GB2312 conversion object in the system.
45 private static Gb2312Convert convert
;
47 // Get the primary GB2312 conversion object.
48 public static Gb2312Convert Convert
51 lock (typeof (Gb2312Convert
)) {
52 if (convert
== null) {
53 convert
= new Gb2312Convert ();