blob: d76a2f4b65dec57007042de51d4f47eeca9e0c54 (
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
|
//
// I18N.CJK.DbcsConvert
//
// Author:
// Alan Tam Siu Lung (Tam@SiuLung.com)
//
using System;
namespace I18N.CJK
{
// This class assists other DBCS encoding classes in converting back
// and forth between JIS character sets and Unicode. It uses
// several large tables to do this, some of which are stored in
// the resource section of the assembly for efficient access.
internal class DbcsConvert
{
// Public access to the conversion tables.
public byte[] n2u;
public byte[] u2n;
// Constructor.
internal DbcsConvert(string fileName) {
using (CodeTable table = new CodeTable(fileName)) {
n2u = table.GetSection(1);
u2n = table.GetSection(2);
}
}
internal static DbcsConvert Gb2312 = new DbcsConvert ("gb2312.table");
}
}
|