Debian Codegraph @

mcs/class/I18N/CJK/DbcsConvert.cs

raw symbols SCIP
1 //
2 // I18N.CJK.DbcsConvert
3 //
4 // Author:
5 // Alan Tam Siu Lung ([email protected])
6 // Atsushi Enomoto <[email protected]>
7 //
8
9 using System;
10
11 namespace I18N.CJK
12 {
13 // This class assists other DBCS encoding classes in converting back
14 // and forth between JIS character sets and Unicode. It uses
15 // several large tables to do this, some of which are stored in
16 // the resource section of the assembly for efficient access.
17 internal class DbcsConvert
18 {
19 // Public access to the conversion tables.
20 public byte[] n2u;
21 public byte[] u2n;
22
23 // Constructor.
24 internal DbcsConvert(string fileName) {
25 using (CodeTable table = new CodeTable(fileName)) {
26 n2u = table.GetSection(1);
27 u2n = table.GetSection(2);
28 }
29 }
30
31 internal static readonly DbcsConvert Gb2312 =
32 new DbcsConvert ("gb2312.table");
33 internal static readonly DbcsConvert Big5 =
34 new DbcsConvert ("big5.table");
35 internal static readonly DbcsConvert KS =
36 new DbcsConvert ("ks.table");
37 }
38 }