//
// I18N.CJK.DBCSConvert
//
// Author:
//   Alan Tam Siu Lung (Tam@SiuLung.com)
//   Atsushi Enomoto  <atsushi@ximian.com>
//

using System;

namespace C1.C1Zip
{
	// 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 readonly DBCSConvert Gb2312 =
			new DBCSConvert ("gb2312.table");
		internal static readonly DBCSConvert Big5 =
			new DBCSConvert ("big5.table");
		internal static readonly DBCSConvert KS =
			new DBCSConvert ("ks.table");
	}
}
