주식회사 누리아이티

정보자산의 보안강화를 위한 2차인증 보안SW 및 지문인식 OTP/출입/보안카드 전문기업

▶ Tuxedo/기술자료

코드 변환 프로그램(ASCII->EBCDIC, EBCDIC->ASCII)

누리아이티 2010. 5. 2. 20:06

/*----------------------------------------------------------------------------*/
/* UNIX header file.                                                          */
/*----------------------------------------------------------------------------*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdarg.h>
#include <errno.h>
/*----------------------------------------------------------------------------*/
/* EBCDIC <--> ASCII Conversion Functions.                                    */
/*----------------------------------------------------------------------------*/
#define  SO           0x0E
#define  SI           0x0F

#define  EBC_SPC      0x40
#define  ASC_SPC      0x20
#define  ASC_NULL     0x00

#define  HIGHBYTE(s)  ((char)(((s) >> 8) & 0xff ))
#define  LOWBYTE(s)   ((char)(s))

#define  ENG_MODE     0
#define  KOR_MODE     1
/*----------------------------------------------------------------------------*/
/* Global variable.                                                           */
/*----------------------------------------------------------------------------*/
int      gi_stype = 2, gi_rtype = 1;
/*----------------------------------------------------------------------------*/
/* 기       능 : English code to IBM Hangul code conversion table.            */
/* 인       수 :                                                              */
/*               Index variabled English code                                 */
/* 반  환   값 :                                                              */
/*               IBM 2 byte English code(성공)                                */
/*               0x4040                 (실패)                                */
/* 특 이 사 항 :                                                              */
/*----------------------------------------------------------------------------*/
unsigned short   Engdbl2ibmTbl[1152] = {
    /*------------------------------------------------------------------------*/
    /* 1ST                                                                    */
    /*------------------------------------------------------------------------*/
     0x4040, 0x4141, 0x4142, 0x4143, 0x4144, 0x4145, 0x4146, 0x4147, 0x4148, 0x4149, 0x414A, 0x414B
    ,0x42A1, 0x414D, 0x414E, 0x414F, 0x4150, 0x4151, 0x4152, 0x4153, 0x4154, 0x4155, 0x4156, 0x4157
    ,0x4158, 0x4159, 0x415A, 0x415B, 0x415C, 0x415D, 0x415E, 0x415F, 0x4160, 0x4161, 0x4162, 0x4163
    ,0x4164, 0x4165, 0x4166, 0x4167, 0x4168, 0x4190, 0x424A, 0x416B, 0x416C, 0x4191, 0x4192, 0x4193
    ,0x4194, 0x4195, 0x4196, 0x4197, 0x4198, 0x4199, 0x4176, 0x4177, 0x4178, 0x4179, 0x417A, 0x417B
    ,0x417C, 0x417D, 0x417E, 0x417F, 0x4180, 0x4181, 0x4182, 0x4183, 0x4184, 0x4185, 0x4186, 0x4187
    ,0x4188, 0x4189, 0x418A, 0x419A, 0x419B, 0x419C, 0x419D, 0x4941, 0x4942, 0x4943, 0x4944, 0x4945
    ,0x4946, 0x4947, 0x4948, 0x4949, 0x494A, 0x494B, 0x494C, 0x494D, 0x494E, 0x425F, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 2ND                                                                    */
    /*------------------------------------------------------------------------*/
    ,0x494F, 0x4950, 0x4951, 0x4952, 0x4953, 0x4954, 0x4955, 0x4956, 0x4957, 0x4958, 0x4959, 0x495A
    ,0x495B, 0x495C, 0x495D, 0x495E, 0x495F, 0x4960, 0x4961, 0x4962, 0x4963, 0x4964, 0x4965, 0x4966
    ,0x4967, 0x4968, 0x4969, 0x496A, 0x496B, 0x496C, 0x496D, 0x496E, 0x496F, 0x4970, 0x4971, 0x4972
    ,0x4973, 0x4974, 0x4975, 0x4976, 0x4977, 0x4978, 0x4979, 0x497A, 0x497B, 0x497C, 0x497D, 0x497E
    ,0x497F, 0x4980, 0x4981, 0x4982, 0x4983, 0x4984, 0x4985, 0x4986, 0x4987, 0x4988, 0x4989, 0x498A
    ,0x498B, 0x498C, 0x498D, 0x498E, 0x498F, 0x4990, 0x4991, 0x4992, 0x4993, 0xFFFF, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 3TH                                                                    */
    /*------------------------------------------------------------------------*/
    ,0x425A, 0x427F, 0x427B, 0x425B, 0x426C, 0x4250, 0x427D, 0x424D, 0x425D, 0x425C, 0x424E, 0x426B
    ,0x4260, 0x424B, 0x4261, 0x42F0, 0x42F1, 0x42F2, 0x42F3, 0x42F4, 0x42F5, 0x42F6, 0x42F7, 0x42F8
    ,0x42F9, 0x427A, 0x425E, 0x424C, 0x427E, 0x426E, 0x426F, 0x427C, 0x42C1, 0x42C2, 0x42C3, 0x42C4
    ,0x42C5, 0x42C6, 0x42C7, 0x42C8, 0x42C9, 0x42D1, 0x42D2, 0x42D3, 0x42D4, 0x42D5, 0x42D6, 0x42D7
    ,0x42D8, 0x42D9, 0x42E2, 0x42E3, 0x42E4, 0x42E5, 0x42E6, 0x42E7, 0x42E8, 0x42E9, 0x418B, 0x42E0
    ,0x418C, 0x414F, 0x426D, 0x4279, 0x4281, 0x4282, 0x4283, 0x4284, 0x4285, 0x4286, 0x4287, 0x4288
    ,0x4289, 0x4291, 0x4292, 0x4293, 0x4294, 0x4295, 0x4296, 0x4297, 0x4298, 0x4299, 0x42A2, 0x42A3
    ,0x42A4, 0x42A5, 0x42A6, 0x42A7, 0x42A8, 0x42A9, 0x42C0, 0x424F, 0x42D0, 0x414C, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 4TH                                                                    */
    /*------------------------------------------------------------------------*/
    ,0x8841, 0x8C41, 0x8444, 0x9041, 0x8446, 0x8447, 0x9441, 0x9841, 0x9C41, 0x844A, 0x844B, 0x844C
    ,0x844D, 0x844E, 0x844F, 0x8450, 0xA041, 0xA441, 0xA841, 0x8454, 0xAC41, 0xB041, 0xB441, 0xB841
    ,0xBC41, 0xC041, 0xC441, 0xC841, 0xCC41, 0xD041, 0x8461, 0x8481, 0x84A1, 0x84C1, 0x84E1, 0x8541
    ,0x8561, 0x8581, 0x85A1, 0x85C1, 0x85E1, 0x8641, 0x8661, 0x8681, 0x86A1, 0x86C1, 0x86E1, 0x8741
    ,0x8761, 0x8781, 0x87A1, 0xFFFF, 0x4341, 0x4342, 0x4343, 0x4344, 0x4345, 0x4346, 0x4347, 0x4348
    ,0x4349, 0x434A, 0x434B, 0x434C, 0x434D, 0x434E, 0x434F, 0x4350, 0x4351, 0x4352, 0x4353, 0x4354
    ,0x4355, 0x4356, 0x4357, 0x4358, 0x4359, 0x435A, 0x435B, 0x435C, 0x435D, 0x435E, 0x435F, 0x4360
    ,0x4361, 0x4362, 0x4363, 0x4364, 0x4365, 0x4366, 0x4367, 0x4368, 0x4369, 0x436A, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 5TH                                                                    */
    /*------------------------------------------------------------------------*/
    ,0x4641, 0x4642, 0x4643, 0x4644, 0x4645, 0x4646, 0x4647, 0x4648, 0x4649, 0x464A, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0x4650, 0x4651, 0x4652, 0x4653, 0x4654, 0x4655, 0x4656, 0x4657, 0x4658
    ,0x4659, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x4661, 0x4662, 0x4663, 0x4664
    ,0x4665, 0x4666, 0x4667, 0x4668, 0x4669, 0x466A, 0x466B, 0x466C, 0x466D, 0x466E, 0x466F, 0x4670
    ,0x4671, 0x4672, 0x4673, 0x4674, 0x4675, 0x4676, 0x4677, 0x4678, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x4681, 0x4682, 0x4683, 0x4684, 0x4685, 0x4686, 0x4687, 0x4688
    ,0x4689, 0x468A, 0x468B, 0x468C, 0x468D, 0x468E, 0x468F, 0x4690, 0x4691, 0x4692, 0x4693, 0x4694
    ,0x4695, 0x4696, 0x4697, 0x4698, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 6TH                                                                    */
    /*------------------------------------------------------------------------*/
    ,0x4741, 0x4742, 0x4743, 0x4744, 0x4745, 0x4746, 0x4747, 0x4748, 0x4749, 0x474A, 0x474B, 0x474C
    ,0x474D, 0x474E, 0x474F, 0x4750, 0x4751, 0x4752, 0x4753, 0x4754, 0x4755, 0x4756, 0x4757, 0x4758
    ,0x4759, 0x475A, 0x475B, 0x475C, 0x475D, 0x475E, 0x475F, 0x4760, 0x4761, 0x4762, 0x4763, 0x4764
    ,0x4765, 0x4766, 0x4767, 0x4768, 0x4769, 0x476A, 0x476B, 0x476C, 0x476D, 0x476E, 0x476F, 0x4770
    ,0x4771, 0x4772, 0x4773, 0x4774, 0x4775, 0x4776, 0x4777, 0x4778, 0x4779, 0x477A, 0x477B, 0x477C
    ,0x477D, 0x477E, 0x477F, 0x4780, 0x4781, 0x4782, 0x4783, 0x4784, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 7TH                                                                    */
    /*------------------------------------------------------------------------*/
    ,0x4841, 0x416D, 0x416E, 0x416F, 0x4842, 0x4170, 0x4843, 0x4844, 0x4845, 0x4846, 0x4847, 0x4848
    ,0x4849, 0x4171, 0x4172, 0x4173, 0x484A, 0x484B, 0x484C, 0x484D, 0x484E, 0x484F, 0x4174, 0x4175
    ,0x4850, 0x4851, 0x4852, 0x4853, 0x4854, 0x4855, 0x4856, 0x4857, 0x4858, 0x4859, 0x485A, 0x485B
    ,0x485C, 0x485D, 0x485E, 0x485F, 0x4860, 0x4861, 0x4862, 0x4863, 0x4864, 0x4865, 0x4866, 0x4867
    ,0x4868, 0x4869, 0x486A, 0x486B, 0x486C, 0x486D, 0x486E, 0x486F, 0x4870, 0x4871, 0x4872, 0x4873
    ,0x4874, 0x4875, 0x4876, 0x4877, 0x4878, 0x4879, 0x487A, 0x487B, 0x487C, 0x487D, 0x487E, 0x487F
    ,0x4880, 0x4881, 0x4882, 0x4883, 0x4884, 0x4885, 0x4886, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 8TH                                                                    */
    /*------------------------------------------------------------------------*/
    ,0x4B41, 0x4B42, 0x4B43, 0x4B44, 0xFFFF, 0x4B46, 0xFFFF, 0x4B48, 0x4B49, 0x4B4A, 0x4B4B, 0x4B4C
    ,0x4B4D, 0x4B4E, 0x4B4F, 0x4040, 0x4B51, 0x4B52, 0x4B53, 0x4B54, 0x4B55, 0x4B56, 0x4B57, 0x4B58
    ,0x4B59, 0x4B5A, 0x4B5B, 0x4B5C, 0x4B5D, 0x4B5E, 0x4B5F, 0x4B60, 0x4B61, 0x4B62, 0x4B63, 0x4B64
    ,0x4B65, 0x4B66, 0x4B67, 0x4B68, 0x4B69, 0x4B6A, 0x4B6B, 0x4B6C, 0x4B6D, 0x4B6E, 0x4B6F, 0x4B70
    ,0x4B71, 0x4B72, 0x4B73, 0x4B74, 0x4B75, 0x4B76, 0x4B77, 0x4B78, 0x4B79, 0x4B7A, 0x4B7B, 0x4B7C
    ,0x4B7D, 0x4B7E, 0x4B7F, 0x4B80, 0x4B81, 0x4B82, 0x4B83, 0x4B84, 0x4B85, 0x4B86, 0x4B87, 0x4B88
    ,0x4B89, 0x4B8A, 0x4B8B, 0x4B8C, 0x4B8D, 0x4B8E, 0x4B8F, 0x4B90, 0x4B91, 0x4B92, 0x4B93, 0x4B94
    ,0x4B95, 0x4B96, 0x4B97, 0x4B98, 0x4B99, 0x4B9A, 0x4B9B, 0x4B9C, 0x4B9D, 0x4B9E, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 9TH                                                                    */
    /*------------------------------------------------------------------------*/
    ,0x4BA0, 0x4BA1, 0x4BA2, 0x4BA3, 0x4BA4, 0x4BA5, 0x4BA6, 0x4BA7, 0x4BA8, 0x4BA9, 0x4BAA, 0x4BAB
    ,0x4BAC, 0x4BAD, 0x4BAE, 0x4BAF, 0x4BB0, 0x4BB1, 0x4BB2, 0x4BB3, 0x4BB4, 0x4BB5, 0x4BB6, 0x4BB7
    ,0x4BB8, 0x4BB9, 0x4BBA, 0x4BBB, 0x4BBC, 0x4BBD, 0x4BBE, 0x4BBF, 0x4BC0, 0x4BC1, 0x4BC2, 0x4BC3
    ,0x4BC4, 0x4BC5, 0x4BC6, 0x4BC7, 0x4BC8, 0x4BC9, 0x4BCA, 0x4BCB, 0x4BCC, 0x4BCD, 0x4BCE, 0x4BCF
    ,0x4BD0, 0x4BD1, 0x4BD2, 0x4BD3, 0x4BD4, 0x4BD5, 0x4BD6, 0x4BD7, 0x4BD8, 0x4BD9, 0x4BDA, 0x4BDB
    ,0x4BDC, 0x4BDD, 0x4BDE, 0x4BDF, 0x4BE0, 0x4BE1, 0x4BE2, 0x4BE3, 0x4BE4, 0x4BE5, 0x4BE6, 0x4BE7
    ,0x4BE8, 0x4BE9, 0x4BEA, 0x4BEB, 0x4BEC, 0x4BED, 0x4BEE, 0x4BEF, 0x4BF0, 0x4BF1, 0x4BF2, 0x4BF3
    ,0x4BF4, 0x4BF5, 0x4BF6, 0x4BF7, 0x4BF8, 0x4BF9, 0x4BFA, 0x4BFB, 0x4BFC, 0x4BFD, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 10TH                                                                   */
    /*------------------------------------------------------------------------*/
    ,0x4441, 0x4442, 0x4443, 0x4444, 0x4445, 0x4446, 0x4447, 0x4448, 0x4449, 0x444A, 0x444B, 0x444C
    ,0x444D, 0x444E, 0x444F, 0x4450, 0x4451, 0x4452, 0x4453, 0x4454, 0x4455, 0x4456, 0x4457, 0x4458
    ,0x4459, 0x445A, 0x445B, 0x445C, 0x445D, 0x445E, 0x445F, 0x4460, 0x4461, 0x4462, 0x4463, 0x4464
    ,0x4465, 0x4466, 0x4467, 0x4468, 0x4469, 0x446A, 0x446B, 0x446C, 0x446D, 0x446E, 0x446F, 0x4470
    ,0x4471, 0x4472, 0x4473, 0x4474, 0x4475, 0x4476, 0x4477, 0x4478, 0x4479, 0x447A, 0x447B, 0x447C
    ,0x447D, 0x447E, 0x447F, 0x4480, 0x4481, 0x4482, 0x4483, 0x4484, 0x4485, 0x4486, 0x4487, 0x4488
    ,0x4489, 0x448A, 0x448B, 0x448C, 0x448D, 0x448E, 0x448F, 0x4490, 0x4491, 0x4492, 0x4493, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 11TH                                                                   */
    /*------------------------------------------------------------------------*/
    ,0x4541, 0x4542, 0x4543, 0x4544, 0x4545, 0x4546, 0x4547, 0x4548, 0x4549, 0x454A, 0x454B, 0x454C
    ,0x454D, 0x454E, 0x454F, 0x4550, 0x4551, 0x4552, 0x4553, 0x4554, 0x4555, 0x4556, 0x4557, 0x4558
    ,0x4559, 0x455A, 0x455B, 0x455C, 0x455D, 0x455E, 0x455F, 0x4560, 0x4561, 0x4562, 0x4563, 0x4564
    ,0x4565, 0x4566, 0x4567, 0x4568, 0x4569, 0x456A, 0x456B, 0x456C, 0x456D, 0x456E, 0x456F, 0x4570
    ,0x4571, 0x4572, 0x4573, 0x4574, 0x4575, 0x4576, 0x4577, 0x4578, 0x4579, 0x457A, 0x457B, 0x457C
    ,0x457D, 0x457E, 0x457F, 0x4580, 0x4581, 0x4582, 0x4583, 0x4584, 0x4585, 0x4586, 0x4587, 0x4588
    ,0x4589, 0x458A, 0x458B, 0x458C, 0x458D, 0x458E, 0x458F, 0x4590, 0x4591, 0x4592, 0x4593, 0x4594
    ,0x4595, 0x4596, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    /*------------------------------------------------------------------------*/
    /* 12TH                                                                   */
    /*------------------------------------------------------------------------*/
    ,0x4A41, 0x4A42, 0x4A43, 0x4A44, 0x4A45, 0x4A46, 0x4A47, 0x4A48, 0x4A49, 0x4A4A, 0x4A4B, 0x4A4C
    ,0x4A4D, 0x4A4E, 0x4A4F, 0x4A50, 0x4A51, 0x4A52, 0x4A53, 0x4A54, 0x4A55, 0x4A56, 0x4A57, 0x4A58
    ,0x4A59, 0x4A5A, 0x4A5B, 0x4A5C, 0x4A5D, 0x4A5E, 0x4A5F, 0x4A60, 0x4A61, 0xFFFF, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
    ,0x4A62, 0x4A63, 0x4A64, 0x4A65, 0x4A66, 0x4A67, 0x4A68, 0x4A69, 0x4A6A, 0x4A6B, 0x4A6C, 0x4A6D
    ,0x4A6E, 0x4A6F, 0x4A70, 0x4A71, 0x4A72, 0x4A73, 0x4A74, 0x4A75, 0x4A76, 0x4A77, 0x4A78, 0x4A79
    ,0x4A7A, 0x4A7B, 0x4A7C, 0x4A7D, 0x4A7E, 0x4A7F, 0x4A81, 0x4A80, 0x4A82, 0xFFFF, 0xFFFF, 0xFFFF
    ,0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
};
/*----------------------------------------------------------------------------*/
/* 기       능 : KS Hangul code to IBM Hangul code conversion table.          */
/* 인       수 :                                                              */
/*               Index variabled KS Hangul code                               */
/* 반  환   값 :                                                              */
/*               IBM 2 byte Hangul code(성공)                                 */
/*               0x4040                (실패)                                 */
/* 특 이 사 항 :                                                              */
/*----------------------------------------------------------------------------*/
unsigned short   Ksc2ibmTbl[2350] = {
    0x8861, 0x8862, 0x8865, 0x8868, 0x8869, 0x886A, 0x886B, 0x8871,
    0x8873, 0x8874, 0x8875, 0x8876, 0x8877, 0x8878, 0x8879, 0x887B,
    0x887C, 0x887D, 0x8881, 0x8882, 0x8885, 0x8889, 0x8891, 0x8893,
    0x8895, 0x8896, 0x8897, 0x88A1, 0x88A2, 0x88A5, 0x88A9, 0x88B5,
    0x88B7, 0x88C1, 0x88C5, 0x88C9, 0x88E1, 0x88E2, 0x88E5, 0x88E8,
    0x88E9, 0x88EB, 0x88F1, 0x88F3, 0x88F5, 0x88F6, 0x88F7, 0x88F8,
    0x88FB, 0x88FC, 0x88FD, 0x8941, 0x8945, 0x8949, 0x8951, 0x8953,
    0x8955, 0x8956, 0x8957, 0x8961, 0x8962, 0x8963, 0x8965, 0x8968,
    0x8969, 0x8971, 0x8973, 0x8975, 0x8976, 0x8977, 0x897B, 0x8981,
    0x8985, 0x8989, 0x8993, 0x8995, 0x89A1, 0x89A2, 0x89A5, 0x89A8,
    0x89A9, 0x89AB, 0x89AD, 0x89B0, 0x89B1, 0x89B3, 0x89B5, 0x89B7,
    0x89B8, 0x89C1, 0x89C2, 0x89C5, 0x89C9, 0x89CB, 0x89D1, 0x89D3,
    0x89D5, 0x89D7, 0x89E1, 0x89E5, 0x89E9, 0x89F3, 0x89F6, 0x89F7,
    0x8A41, 0x8A42, 0x8A45, 0x8A49, 0x8A51, 0x8A53, 0x8A55, 0x8A57,
    0x8A61, 0x8A65, 0x8A69, 0x8A73, 0x8A75, 0x8A81, 0x8A82, 0x8A85,
    0x8A88, 0x8A89, 0x8A8A, 0x8A8B, 0x8A90, 0x8A91, 0x8A93, 0x8A95,
    0x8A97, 0x8A98, 0x8AA1, 0x8AA2, 0x8AA5, 0x8AA9, 0x8AB6, 0x8AB7,
    0x8AC1, 0x8AD5, 0x8AE1, 0x8AE2, 0x8AE5, 0x8AE9, 0x8AF1, 0x8AF3,
    0x8AF5, 0x8B41, 0x8B45, 0x8B49, 0x8B61, 0x8B62, 0x8B65, 0x8B68,
    0x8B69, 0x8B6A, 0x8B71, 0x8B73, 0x8B75, 0x8B77, 0x8B81, 0x8BA1,
    0x8BA2, 0x8BA5, 0x8BA8, 0x8BA9, 0x8BAB, 0x8BB1, 0x8BB3, 0x8BB5,
    0x8BB7, 0x8BB8, 0x8BBC, 0x8C61, 0x8C62, 0x8C63, 0x8C65, 0x8C69,
    0x8C6B, 0x8C71, 0x8C73, 0x8C75, 0x8C76, 0x8C77, 0x8C7B, 0x8C81,
    0x8C82, 0x8C85, 0x8C89, 0x8C91, 0x8C93, 0x8C95, 0x8C96, 0x8C97,
    0x8CA1, 0x8CA2, 0x8CA9, 0x8CE1, 0x8CE2, 0x8CE3, 0x8CE5, 0x8CE9,
    0x8CF1, 0x8CF3, 0x8CF5, 0x8CF6, 0x8CF7, 0x8D41, 0x8D42, 0x8D45,
    0x8D51, 0x8D55, 0x8D57, 0x8D61, 0x8D65, 0x8D69, 0x8D75, 0x8D76,
    0x8D7B, 0x8D81, 0x8DA1, 0x8DA2, 0x8DA5, 0x8DA7, 0x8DA9, 0x8DB1,
    0x8DB3, 0x8DB5, 0x8DB7, 0x8DB8, 0x8DB9, 0x8DC1, 0x8DC2, 0x8DC9,
    0x8DD6, 0x8DD7, 0x8DE1, 0x8DE2, 0x8DF7, 0x8E41, 0x8E45, 0x8E49,
    0x8E51, 0x8E53, 0x8E57, 0x8E61, 0x8E81, 0x8E82, 0x8E85, 0x8E89,
    0x8E90, 0x8E91, 0x8E93, 0x8E95, 0x8E97, 0x8E98, 0x8EA1, 0x8EA9,
    0x8EB6, 0x8EB7, 0x8EC1, 0x8EC2, 0x8EC5, 0x8EC9, 0x8ED1, 0x8ED3,
    0x8ED6, 0x8EE1, 0x8EE5, 0x8EE9, 0x8EF1, 0x8EF3, 0x8F41, 0x8F61,
    0x8F62, 0x8F65, 0x8F67, 0x8F69, 0x8F6B, 0x8F70, 0x8F71, 0x8F73,
    0x8F75, 0x8F77, 0x8F7B, 0x8FA1, 0x8FA2, 0x8FA5, 0x8FA9, 0x8FB1,
    0x8FB3, 0x8FB5, 0x8FB7, 0x9061, 0x9062, 0x9063, 0x9065, 0x9068,
    0x9069, 0x906A, 0x906B, 0x9071, 0x9073, 0x9075, 0x9076, 0x9077,
    0x9078, 0x9079, 0x907B, 0x907D, 0x9081, 0x9082, 0x9085, 0x9089,
    0x9091, 0x9093, 0x9095, 0x9096, 0x9097, 0x90A1, 0x90A2, 0x90A5,
    0x90A9, 0x90B1, 0x90B7, 0x90E1, 0x90E2, 0x90E4, 0x90E5, 0x90E9,
    0x90EB, 0x90EC, 0x90F1, 0x90F3, 0x90F5, 0x90F6, 0x90F7, 0x90FD,
    0x9141, 0x9142, 0x9145, 0x9149, 0x9151, 0x9153, 0x9155, 0x9156,
    0x9157, 0x9161, 0x9162, 0x9165, 0x9169, 0x9171, 0x9173, 0x9176,
    0x9177, 0x917A, 0x9181, 0x9185, 0x91A1, 0x91A2, 0x91A5, 0x91A9,
    0x91AB, 0x91B1, 0x91B3, 0x91B5, 0x91B7, 0x91BC, 0x91BD, 0x91C1,
    0x91C5, 0x91C9, 0x91D6, 0x9241, 0x9245, 0x9249, 0x9251, 0x9253,
    0x9255, 0x9261, 0x9262, 0x9265, 0x9269, 0x9273, 0x9275, 0x9277,
    0x9281, 0x9282, 0x9285, 0x9288, 0x9289, 0x9291, 0x9293, 0x9295,
    0x9297, 0x92A1, 0x92B6, 0x92C1, 0x92E1, 0x92E5, 0x92E9, 0x92F1,
    0x92F3, 0x9341, 0x9342, 0x9349, 0x9351, 0x9353, 0x9357, 0x9361,
    0x9362, 0x9365, 0x9369, 0x936A, 0x936B, 0x9371, 0x9373, 0x9375,
    0x9377, 0x9378, 0x937C, 0x9381, 0x9385, 0x9389, 0x93A1, 0x93A2,
    0x93A5, 0x93A9, 0x93AB, 0x93B1, 0x93B3, 0x93B5, 0x93B7, 0x93BC,
    0x9461, 0x9462, 0x9463, 0x9465, 0x9468, 0x9469, 0x946A, 0x946B,
    0x946C, 0x9470, 0x9471, 0x9473, 0x9475, 0x9476, 0x9477, 0x9478,
    0x9479, 0x947D, 0x9481, 0x9482, 0x9485, 0x9489, 0x9491, 0x9493,
    0x9495, 0x9496, 0x9497, 0x94A1, 0x94E1, 0x94E2, 0x94E3, 0x94E5,
    0x94E8, 0x94E9, 0x94EB, 0x94EC, 0x94F1, 0x94F3, 0x94F5, 0x94F7,
    0x94F9, 0x94FC, 0x9541, 0x9542, 0x9545, 0x9549, 0x9551, 0x9553,
    0x9555, 0x9556, 0x9557, 0x9561, 0x9565, 0x9569, 0x9576, 0x9577,
    0x9581, 0x9585, 0x95A1, 0x95A2, 0x95A5, 0x95A8, 0x95A9, 0x95AB,
    0x95AD, 0x95B1, 0x95B3, 0x95B5, 0x95B7, 0x95B9, 0x95BB, 0x95C1,
    0x95C5, 0x95C9, 0x95E1, 0x95F6, 0x9641, 0x9645, 0x9649, 0x9651,
    0x9653, 0x9655, 0x9661, 0x9681, 0x9682, 0x9685, 0x9689, 0x9691,
    0x9693, 0x9695, 0x9697, 0x96A1, 0x96B6, 0x96C1, 0x96D7, 0x96E1,
    0x96E5, 0x96E9, 0x96F3, 0x96F5, 0x96F7, 0x9741, 0x9745, 0x9749,
    0x9751, 0x9757, 0x9761, 0x9762, 0x9765, 0x9768, 0x9769, 0x976B,
    0x9771, 0x9773, 0x9775, 0x9777, 0x9781, 0x97A1, 0x97A2, 0x97A5,
    0x97A8, 0x97A9, 0x97B1, 0x97B3, 0x97B5, 0x97B6, 0x97B7, 0x97B8,
    0x9861, 0x9862, 0x9865, 0x9869, 0x9871, 0x9873, 0x9875, 0x9876,
    0x9877, 0x987D, 0x9881, 0x9882, 0x9885, 0x9889, 0x9891, 0x9893,
    0x9895, 0x9896, 0x9897, 0x98E1, 0x98E2, 0x98E5, 0x98E9, 0x98EB,
    0x98EC, 0x98F1, 0x98F3, 0x98F5, 0x98F6, 0x98F7, 0x98FD, 0x9941,
    0x9942, 0x9945, 0x9949, 0x9951, 0x9953, 0x9955, 0x9956, 0x9957,
    0x9961, 0x9976, 0x99A1, 0x99A2, 0x99A5, 0x99A9, 0x99B7, 0x99C1,
    0x99C9, 0x99E1, 0x9A41, 0x9A45, 0x9A81, 0x9A82, 0x9A85, 0x9A89,
    0x9A90, 0x9A91, 0x9A97, 0x9AC1, 0x9AE1, 0x9AE5, 0x9AE9, 0x9AF1,
    0x9AF3, 0x9AF7, 0x9B61, 0x9B62, 0x9B65, 0x9B68, 0x9B69, 0x9B71,
    0x9B73, 0x9B75, 0x9B81, 0x9B85, 0x9B89, 0x9B91, 0x9B93, 0x9BA1,
    0x9BA5, 0x9BA9, 0x9BB1, 0x9BB3, 0x9BB5, 0x9BB7, 0x9C61, 0x9C62,
    0x9C65, 0x9C69, 0x9C71, 0x9C73, 0x9C75, 0x9C76, 0x9C77, 0x9C78,
    0x9C7C, 0x9C7D, 0x9C81, 0x9C82, 0x9C85, 0x9C89, 0x9C91, 0x9C93,
    0x9C95, 0x9C96, 0x9C97, 0x9CA1, 0x9CA2, 0x9CA5, 0x9CB5, 0x9CB7,
    0x9CE1, 0x9CE2, 0x9CE5, 0x9CE9, 0x9CF1, 0x9CF3, 0x9CF5, 0x9CF6,
    0x9CF7, 0x9CFD, 0x9D41, 0x9D42, 0x9D45, 0x9D49, 0x9D51, 0x9D53,
    0x9D55, 0x9D57, 0x9D61, 0x9D62, 0x9D65, 0x9D69, 0x9D71, 0x9D73,
    0x9D75, 0x9D76, 0x9D77, 0x9D81, 0x9D85, 0x9D93, 0x9D95, 0x9DA1,
    0x9DA2, 0x9DA5, 0x9DA9, 0x9DB1, 0x9DB3, 0x9DB5, 0x9DB7, 0x9DC1,
    0x9DC5, 0x9DD7, 0x9DF6, 0x9E41, 0x9E45, 0x9E49, 0x9E51, 0x9E53,
    0x9E55, 0x9E57, 0x9E61, 0x9E65, 0x9E69, 0x9E73, 0x9E75, 0x9E77,
    0x9E81, 0x9E82, 0x9E85, 0x9E89, 0x9E91, 0x9E93, 0x9E95, 0x9E97,
    0x9EA1, 0x9EB6, 0x9EC1, 0x9EE1, 0x9EE2, 0x9EE5, 0x9EE9, 0x9EF1,
    0x9EF5, 0x9EF7, 0x9F41, 0x9F42, 0x9F45, 0x9F49, 0x9F51, 0x9F53,
    0x9F55, 0x9F57, 0x9F61, 0x9F62, 0x9F65, 0x9F69, 0x9F71, 0x9F73,
    0x9F75, 0x9F77, 0x9F78, 0x9F7B, 0x9F7C, 0x9FA1, 0x9FA2, 0x9FA5,
    0x9FA9, 0x9FB1, 0x9FB3, 0x9FB5, 0x9FB7, 0xA061, 0xA062, 0xA065,
    0xA067, 0xA068, 0xA069, 0xA06A, 0xA06B, 0xA071, 0xA073, 0xA075,
    0xA077, 0xA078, 0xA07B, 0xA07D, 0xA081, 0xA082, 0xA085, 0xA089,
    0xA091, 0xA093, 0xA095, 0xA096, 0xA097, 0xA098, 0xA0A1, 0xA0A2,
    0xA0A9, 0xA0B7, 0xA0E1, 0xA0E2, 0xA0E5, 0xA0E9, 0xA0EB, 0xA0F1,
    0xA0F3, 0xA0F5, 0xA0F7, 0xA0F8, 0xA0FD, 0xA141, 0xA142, 0xA145,
    0xA149, 0xA151, 0xA153, 0xA155, 0xA156, 0xA157, 0xA161, 0xA162,
    0xA165, 0xA169, 0xA175, 0xA176, 0xA177, 0xA179, 0xA181, 0xA1A1,
    0xA1A2, 0xA1A4, 0xA1A5, 0xA1A9, 0xA1AB, 0xA1B1, 0xA1B3, 0xA1B5,
    0xA1B7, 0xA1C1, 0xA1C5, 0xA1D6, 0xA1D7, 0xA241, 0xA245, 0xA249,
    0xA253, 0xA255, 0xA257, 0xA261, 0xA265, 0xA269, 0xA273, 0xA275,
    0xA281, 0xA282, 0xA283, 0xA285, 0xA288, 0xA289, 0xA28A, 0xA28B,
    0xA291, 0xA293, 0xA295, 0xA297, 0xA29B, 0xA29D, 0xA2A1, 0xA2A5,
    0xA2A9, 0xA2B3, 0xA2B5, 0xA2C1, 0xA2E1, 0xA2E5, 0xA2E9, 0xA341,
    0xA345, 0xA349, 0xA351, 0xA355, 0xA361, 0xA365, 0xA369, 0xA371,
    0xA375, 0xA3A1, 0xA3A2, 0xA3A5, 0xA3A8, 0xA3A9, 0xA3AB, 0xA3B1,
    0xA3B3, 0xA3B5, 0xA3B6, 0xA3B7, 0xA3B9, 0xA3BB, 0xA461, 0xA462,
    0xA463, 0xA464, 0xA465, 0xA468, 0xA469, 0xA46A, 0xA46B, 0xA46C,
    0xA471, 0xA473, 0xA475, 0xA477, 0xA47B, 0xA481, 0xA482, 0xA485,
    0xA489, 0xA491, 0xA493, 0xA495, 0xA496, 0xA497, 0xA49B, 0xA4A1,
    0xA4A2, 0xA4A5, 0xA4B3, 0xA4E1, 0xA4E2, 0xA4E5, 0xA4E8, 0xA4E9,
    0xA4EB, 0xA4F1, 0xA4F3, 0xA4F5, 0xA4F7, 0xA4F8, 0xA541, 0xA542,
    0xA545, 0xA548, 0xA549, 0xA551, 0xA553, 0xA555, 0xA556, 0xA557,
    0xA561, 0xA562, 0xA565, 0xA569, 0xA573, 0xA575, 0xA576, 0xA577,
    0xA57B, 0xA581, 0xA585, 0xA5A1, 0xA5A2, 0xA5A3, 0xA5A5, 0xA5A9,
    0xA5B1, 0xA5B3, 0xA5B5, 0xA5B7, 0xA5C1, 0xA5C5, 0xA5D6, 0xA5E1,
    0xA5F6, 0xA641, 0xA642, 0xA645, 0xA649, 0xA651, 0xA653, 0xA661,
    0xA665, 0xA681, 0xA682, 0xA685, 0xA688, 0xA689, 0xA68A, 0xA68B,
    0xA691, 0xA693, 0xA695, 0xA697, 0xA69B, 0xA69C, 0xA6A1, 0xA6A9,
    0xA6B6, 0xA6C1, 0xA6E1, 0xA6E2, 0xA6E5, 0xA6E9, 0xA6F7, 0xA741,
    0xA745, 0xA749, 0xA751, 0xA755, 0xA757, 0xA761, 0xA762, 0xA765,
    0xA769, 0xA771, 0xA773, 0xA775, 0xA7A1, 0xA7A2, 0xA7A5, 0xA7A9,
    0xA7AB, 0xA7B1, 0xA7B3, 0xA7B5, 0xA7B7, 0xA7B8, 0xA7B9, 0xA861,
    0xA862, 0xA865, 0xA869, 0xA86B, 0xA871, 0xA873, 0xA875, 0xA876,
    0xA877, 0xA87D, 0xA881, 0xA882, 0xA885, 0xA889, 0xA891, 0xA893,
    0xA895, 0xA896, 0xA897, 0xA8A1, 0xA8A2, 0xA8B1, 0xA8E1, 0xA8E2,
    0xA8E5, 0xA8E8, 0xA8E9, 0xA8F1, 0xA8F5, 0xA8F6, 0xA8F7, 0xA941,
    0xA957, 0xA961, 0xA962, 0xA971, 0xA973, 0xA975, 0xA976, 0xA977,
    0xA9A1, 0xA9A2, 0xA9A5, 0xA9A9, 0xA9B1, 0xA9B3, 0xA9B7, 0xAA41,
    0xAA61, 0xAA77, 0xAA81, 0xAA82, 0xAA85, 0xAA89, 0xAA91, 0xAA95,
    0xAA97, 0xAB41, 0xAB57, 0xAB61, 0xAB65, 0xAB69, 0xAB71, 0xAB73,
    0xABA1, 0xABA2, 0xABA5, 0xABA9, 0xABB1, 0xABB3, 0xABB5, 0xABB7,
    0xAC61, 0xAC62, 0xAC64, 0xAC65, 0xAC68, 0xAC69, 0xAC6A, 0xAC6B,
    0xAC71, 0xAC73, 0xAC75, 0xAC76, 0xAC77, 0xAC7B, 0xAC81, 0xAC82,
    0xAC85, 0xAC89, 0xAC91, 0xAC93, 0xAC95, 0xAC96, 0xAC97, 0xACA1,
    0xACA2, 0xACA5, 0xACA9, 0xACB1, 0xACB3, 0xACB5, 0xACB7, 0xACC1,
    0xACC5, 0xACC9, 0xACD1, 0xACD7, 0xACE1, 0xACE2, 0xACE3, 0xACE4,
    0xACE5, 0xACE8, 0xACE9, 0xACEB, 0xACEC, 0xACF1, 0xACF3, 0xACF5,
    0xACF6, 0xACF7, 0xACFC, 0xAD41, 0xAD42, 0xAD45, 0xAD49, 0xAD51,
    0xAD53, 0xAD55, 0xAD56, 0xAD57, 0xAD61, 0xAD62, 0xAD65, 0xAD69,
    0xAD71, 0xAD73, 0xAD75, 0xAD76, 0xAD77, 0xAD81, 0xAD85, 0xAD89,
    0xAD97, 0xADA1, 0xADA2, 0xADA3, 0xADA5, 0xADA9, 0xADAB, 0xADB1,
    0xADB3, 0xADB5, 0xADB7, 0xADBB, 0xADC1, 0xADC2, 0xADC5, 0xADC9,
    0xADD7, 0xADE1, 0xADE5, 0xADE9, 0xADF1, 0xADF5, 0xADF6, 0xAE41,
    0xAE45, 0xAE49, 0xAE51, 0xAE53, 0xAE55, 0xAE61, 0xAE62, 0xAE65,
    0xAE69, 0xAE71, 0xAE73, 0xAE75, 0xAE77, 0xAE81, 0xAE82, 0xAE85,
    0xAE88, 0xAE89, 0xAE91, 0xAE93, 0xAE95, 0xAE97, 0xAE99, 0xAE9B,
    0xAE9C, 0xAEA1, 0xAEB6, 0xAEC1, 0xAEC2, 0xAEC5, 0xAEC9, 0xAED1,
    0xAED7, 0xAEE1, 0xAEE2, 0xAEE5, 0xAEE9, 0xAEF1, 0xAEF3, 0xAEF5,
    0xAEF7, 0xAF41, 0xAF42, 0xAF49, 0xAF51, 0xAF55, 0xAF57, 0xAF61,
    0xAF62, 0xAF65, 0xAF69, 0xAF6A, 0xAF71, 0xAF73, 0xAF75, 0xAF77,
    0xAFA1, 0xAFA2, 0xAFA5, 0xAFA8, 0xAFA9, 0xAFB0, 0xAFB1, 0xAFB3,
    0xAFB5, 0xAFB7, 0xAFBC, 0xB061, 0xB062, 0xB064, 0xB065, 0xB069,
    0xB071, 0xB073, 0xB076, 0xB077, 0xB07D, 0xB081, 0xB082, 0xB085,
    0xB089, 0xB091, 0xB093, 0xB096, 0xB097, 0xB0B7, 0xB0E1, 0xB0E2,
    0xB0E5, 0xB0E9, 0xB0EB, 0xB0F1, 0xB0F3, 0xB0F6, 0xB0F7, 0xB141,
    0xB145, 0xB149, 0xB185, 0xB1A1, 0xB1A2, 0xB1A5, 0xB1A8, 0xB1A9,
    0xB1AB, 0xB1B1, 0xB1B3, 0xB1B7, 0xB1C1, 0xB1C2, 0xB1C5, 0xB1D6,
    0xB1E1, 0xB1F6, 0xB241, 0xB245, 0xB249, 0xB251, 0xB253, 0xB261,
    0xB281, 0xB282, 0xB285, 0xB289, 0xB291, 0xB293, 0xB297, 0xB2A1,
    0xB2B6, 0xB2C1, 0xB2E1, 0xB2E5, 0xB357, 0xB361, 0xB362, 0xB365,
    0xB369, 0xB36B, 0xB370, 0xB371, 0xB373, 0xB381, 0xB385, 0xB389,
    0xB391, 0xB3A1, 0xB3A2, 0xB3A5, 0xB3A9, 0xB3B1, 0xB3B3, 0xB3B5,
    0xB3B7, 0xB461, 0xB462, 0xB465, 0xB466, 0xB467, 0xB469, 0xB46A,
    0xB46B, 0xB470, 0xB471, 0xB473, 0xB475, 0xB476, 0xB477, 0xB47B,
    0xB47C, 0xB481, 0xB482, 0xB485, 0xB489, 0xB491, 0xB493, 0xB495,
    0xB496, 0xB497, 0xB4A1, 0xB4A2, 0xB4A5, 0xB4A9, 0xB4AC, 0xB4B1,
    0xB4B3, 0xB4B5, 0xB4B7, 0xB4BB, 0xB4BD, 0xB4C1, 0xB4C5, 0xB4C9,
    0xB4D3, 0xB4E1, 0xB4E2, 0xB4E5, 0xB4E6, 0xB4E8, 0xB4E9, 0xB4EA,
    0xB4EB, 0xB4F1, 0xB4F3, 0xB4F4, 0xB4F5, 0xB4F6, 0xB4F7, 0xB4F8,
    0xB4FA, 0xB4FC, 0xB541, 0xB542, 0xB545, 0xB549, 0xB551, 0xB553,
    0xB555, 0xB557, 0xB561, 0xB562, 0xB563, 0xB565, 0xB569, 0xB56B,
    0xB56C, 0xB571, 0xB573, 0xB574, 0xB575, 0xB576, 0xB577, 0xB57B,
    0xB57C, 0xB57D, 0xB581, 0xB585, 0xB589, 0xB591, 0xB593, 0xB595,
    0xB596, 0xB5A1, 0xB5A2, 0xB5A5, 0xB5A9, 0xB5AA, 0xB5AB, 0xB5AD,
    0xB5B0, 0xB5B1, 0xB5B3, 0xB5B5, 0xB5B7, 0xB5B9, 0xB5C1, 0xB5C2,
    0xB5C5, 0xB5C9, 0xB5D1, 0xB5D3, 0xB5D5, 0xB5D6, 0xB5D7, 0xB5E1,
    0xB5E2, 0xB5E5, 0xB5F1, 0xB5F5, 0xB5F7, 0xB641, 0xB642, 0xB645,
    0xB649, 0xB651, 0xB653, 0xB655, 0xB657, 0xB661, 0xB662, 0xB665,
    0xB669, 0xB671, 0xB673, 0xB675, 0xB677, 0xB681, 0xB682, 0xB685,
    0xB689, 0xB68A, 0xB68B, 0xB691, 0xB693, 0xB695, 0xB697, 0xB6A1,
    0xB6A2, 0xB6A5, 0xB6A9, 0xB6B1, 0xB6B3, 0xB6B6, 0xB6B7, 0xB6C1,
    0xB6C2, 0xB6C5, 0xB6C9, 0xB6D1, 0xB6D3, 0xB6D7, 0xB6E1, 0xB6E2,
    0xB6E5, 0xB6E9, 0xB6F1, 0xB6F3, 0xB6F5, 0xB6F7, 0xB741, 0xB742,
    0xB745, 0xB749, 0xB751, 0xB753, 0xB755, 0xB757, 0xB759, 0xB761,
    0xB762, 0xB765, 0xB769, 0xB76F, 0xB771, 0xB773, 0xB775, 0xB777,
    0xB778, 0xB779, 0xB77A, 0xB77B, 0xB77C, 0xB77D, 0xB781, 0xB785,
    0xB789, 0xB791, 0xB795, 0xB7A1, 0xB7A2, 0xB7A5, 0xB7A9, 0xB7AA,
    0xB7AB, 0xB7B0, 0xB7B1, 0xB7B3, 0xB7B5, 0xB7B6, 0xB7B7, 0xB7B8,
    0xB7BC, 0xB861, 0xB862, 0xB865, 0xB867, 0xB868, 0xB869, 0xB86B,
    0xB871, 0xB873, 0xB875, 0xB876, 0xB877, 0xB878, 0xB881, 0xB882,
    0xB885, 0xB889, 0xB891, 0xB893, 0xB895, 0xB896, 0xB897, 0xB8A1,
    0xB8A2, 0xB8A5, 0xB8A7, 0xB8A9, 0xB8B1, 0xB8B7, 0xB8C1, 0xB8C5,
    0xB8C9, 0xB8E1, 0xB8E2, 0xB8E5, 0xB8E9, 0xB8EB, 0xB8F1, 0xB8F3,
    0xB8F5, 0xB8F7, 0xB8F8, 0xB941, 0xB942, 0xB945, 0xB949, 0xB951,
    0xB953, 0xB955, 0xB957, 0xB961, 0xB965, 0xB969, 0xB971, 0xB973,
    0xB976, 0xB977, 0xB981, 0xB9A1, 0xB9A2, 0xB9A5, 0xB9A9, 0xB9AB,
    0xB9B1, 0xB9B3, 0xB9B5, 0xB9B7, 0xB9B8, 0xB9B9, 0xB9BD, 0xB9C1,
    0xB9C2, 0xB9C9, 0xB9D3, 0xB9D5, 0xB9D7, 0xB9E1, 0xB9F6, 0xB9F7,
    0xBA41, 0xBA45, 0xBA49, 0xBA51, 0xBA53, 0xBA55, 0xBA57, 0xBA61,
    0xBA62, 0xBA65, 0xBA77, 0xBA81, 0xBA82, 0xBA85, 0xBA89, 0xBA8A,
    0xBA8B, 0xBA91, 0xBA93, 0xBA95, 0xBA97, 0xBAA1, 0xBAB6, 0xBAC1,
    0xBAE1, 0xBAE2, 0xBAE5, 0xBAE9, 0xBAF1, 0xBAF3, 0xBAF5, 0xBB41,
    0xBB45, 0xBB49, 0xBB51, 0xBB61, 0xBB62, 0xBB65, 0xBB69, 0xBB71,
    0xBB73, 0xBB75, 0xBB77, 0xBBA1, 0xBBA2, 0xBBA5, 0xBBA8, 0xBBA9,
    0xBBAB, 0xBBB1, 0xBBB3, 0xBBB5, 0xBBB7, 0xBBB8, 0xBBBB, 0xBBBC,
    0xBC61, 0xBC62, 0xBC65, 0xBC67, 0xBC69, 0xBC6C, 0xBC71, 0xBC73,
    0xBC75, 0xBC76, 0xBC77, 0xBC81, 0xBC82, 0xBC85, 0xBC89, 0xBC91,
    0xBC93, 0xBC95, 0xBC96, 0xBC97, 0xBCA1, 0xBCA5, 0xBCB7, 0xBCE1,
    0xBCE2, 0xBCE5, 0xBCE9, 0xBCF1, 0xBCF3, 0xBCF5, 0xBCF6, 0xBCF7,
    0xBD41, 0xBD57, 0xBD61, 0xBD76, 0xBDA1, 0xBDA2, 0xBDA5, 0xBDA9,
    0xBDB1, 0xBDB3, 0xBDB5, 0xBDB7, 0xBDB9, 0xBDC1, 0xBDC2, 0xBDC9,
    0xBDD6, 0xBDE1, 0xBDF6, 0xBE41, 0xBE45, 0xBE49, 0xBE51, 0xBE53,
    0xBE77, 0xBE81, 0xBE82, 0xBE85, 0xBE89, 0xBE91, 0xBE93, 0xBE97,
    0xBEA1, 0xBEB6, 0xBEB7, 0xBEE1, 0xBF41, 0xBF61, 0xBF71, 0xBF75,
    0xBF77, 0xBFA1, 0xBFA2, 0xBFA5, 0xBFA9, 0xBFB1, 0xBFB3, 0xBFB7,
    0xBFB8, 0xBFBD, 0xC061, 0xC062, 0xC065, 0xC067, 0xC069, 0xC071,
    0xC073, 0xC075, 0xC076, 0xC077, 0xC078, 0xC081, 0xC082, 0xC085,
    0xC089, 0xC091, 0xC093, 0xC095, 0xC096, 0xC097, 0xC0A1, 0xC0A5,
    0xC0A7, 0xC0A9, 0xC0B1, 0xC0B7, 0xC0E1, 0xC0E2, 0xC0E5, 0xC0E9,
    0xC0F1, 0xC0F3, 0xC0F5, 0xC0F6, 0xC0F7, 0xC141, 0xC142, 0xC145,
    0xC149, 0xC151, 0xC153, 0xC155, 0xC157, 0xC161, 0xC165, 0xC176,
    0xC181, 0xC185, 0xC197, 0xC1A1, 0xC1A2, 0xC1A5, 0xC1A9, 0xC1B1,
    0xC1B3, 0xC1B5, 0xC1B7, 0xC1C1, 0xC1C5, 0xC1C9, 0xC1D7, 0xC241,
    0xC245, 0xC249, 0xC251, 0xC253, 0xC255, 0xC257, 0xC261, 0xC271,
    0xC281, 0xC282, 0xC285, 0xC289, 0xC291, 0xC293, 0xC295, 0xC297,
    0xC2A1, 0xC2B6, 0xC2C1, 0xC2C5, 0xC2E1, 0xC2E5, 0xC2E9, 0xC2F1,
    0xC2F3, 0xC2F5, 0xC2F7, 0xC341, 0xC345, 0xC349, 0xC351, 0xC357,
    0xC361, 0xC362, 0xC365, 0xC369, 0xC371, 0xC373, 0xC375, 0xC377,
    0xC3A1, 0xC3A2, 0xC3A5, 0xC3A8, 0xC3A9, 0xC3AA, 0xC3B1, 0xC3B3,
    0xC3B5, 0xC3B7, 0xC461, 0xC462, 0xC465, 0xC469, 0xC471, 0xC473,
    0xC475, 0xC477, 0xC481, 0xC482, 0xC485, 0xC489, 0xC491, 0xC493,
    0xC495, 0xC496, 0xC497, 0xC4A1, 0xC4A2, 0xC4B7, 0xC4E1, 0xC4E2,
    0xC4E5, 0xC4E8, 0xC4E9, 0xC4F1, 0xC4F3, 0xC4F5, 0xC4F6, 0xC4F7,
    0xC541, 0xC542, 0xC545, 0xC549, 0xC551, 0xC553, 0xC555, 0xC557,
    0xC561, 0xC565, 0xC569, 0xC571, 0xC573, 0xC575, 0xC576, 0xC577,
    0xC581, 0xC5A1, 0xC5A2, 0xC5A5, 0xC5A9, 0xC5B1, 0xC5B3, 0xC5B5,
    0xC5B7, 0xC5C1, 0xC5C2, 0xC5C5, 0xC5C9, 0xC5D1, 0xC5D7, 0xC5E1,
    0xC5F7, 0xC641, 0xC649, 0xC661, 0xC681, 0xC682, 0xC685, 0xC689,
    0xC691, 0xC693, 0xC695, 0xC697, 0xC6A1, 0xC6A5, 0xC6A9, 0xC6B7,
    0xC6C1, 0xC6D7, 0xC6E1, 0xC6E2, 0xC6E5, 0xC6E9, 0xC6F1, 0xC6F3,
    0xC6F5, 0xC6F7, 0xC741, 0xC745, 0xC749, 0xC751, 0xC761, 0xC762,
    0xC765, 0xC769, 0xC771, 0xC773, 0xC777, 0xC7A1, 0xC7A2, 0xC7A5,
    0xC7A9, 0xC7B1, 0xC7B3, 0xC7B5, 0xC7B7, 0xC861, 0xC862, 0xC865,
    0xC869, 0xC86A, 0xC871, 0xC873, 0xC875, 0xC876, 0xC877, 0xC881,
    0xC882, 0xC885, 0xC889, 0xC891, 0xC893, 0xC895, 0xC896, 0xC897,
    0xC8A1, 0xC8B7, 0xC8E1, 0xC8E2, 0xC8E5, 0xC8E9, 0xC8EB, 0xC8F1,
    0xC8F3, 0xC8F5, 0xC8F6, 0xC8F7, 0xC941, 0xC942, 0xC945, 0xC949,
    0xC951, 0xC953, 0xC955, 0xC957, 0xC961, 0xC965, 0xC976, 0xC981,
    0xC985, 0xC9A1, 0xC9A2, 0xC9A5, 0xC9A9, 0xC9B1, 0xC9B3, 0xC9B5,
    0xC9B7, 0xC9BC, 0xC9C1, 0xC9C5, 0xC9E1, 0xCA41, 0xCA45, 0xCA55,
    0xCA57, 0xCA61, 0xCA81, 0xCA82, 0xCA85, 0xCA89, 0xCA91, 0xCA93,
    0xCA95, 0xCA97, 0xCAA1, 0xCAB6, 0xCAC1, 0xCAE1, 0xCAE2, 0xCAE5,
    0xCAE9, 0xCAF1, 0xCAF3, 0xCAF7, 0xCB41, 0xCB45, 0xCB49, 0xCB51,
    0xCB57, 0xCB61, 0xCB62, 0xCB65, 0xCB68, 0xCB69, 0xCB6B, 0xCB71,
    0xCB73, 0xCB75, 0xCB81, 0xCB85, 0xCB89, 0xCB91, 0xCB93, 0xCBA1,
    0xCBA2, 0xCBA5, 0xCBA9, 0xCBB1, 0xCBB3, 0xCBB5, 0xCBB7, 0xCC61,
    0xCC62, 0xCC63, 0xCC65, 0xCC69, 0xCC6B, 0xCC71, 0xCC73, 0xCC75,
    0xCC76, 0xCC77, 0xCC7B, 0xCC81, 0xCC82, 0xCC85, 0xCC89, 0xCC91,
    0xCC93, 0xCC95, 0xCC96, 0xCC97, 0xCCA1, 0xCCA2, 0xCCE1, 0xCCE2,
    0xCCE5, 0xCCE9, 0xCCF1, 0xCCF3, 0xCCF5, 0xCCF6, 0xCCF7, 0xCD41,
    0xCD42, 0xCD45, 0xCD49, 0xCD51, 0xCD53, 0xCD55, 0xCD57, 0xCD61,
    0xCD65, 0xCD69, 0xCD71, 0xCD73, 0xCD76, 0xCD77, 0xCD81, 0xCD89,
    0xCD93, 0xCD95, 0xCDA1, 0xCDA2, 0xCDA5, 0xCDA9, 0xCDB1, 0xCDB3,
    0xCDB5, 0xCDB7, 0xCDC1, 0xCDD7, 0xCE41, 0xCE45, 0xCE61, 0xCE65,
    0xCE69, 0xCE73, 0xCE75, 0xCE81, 0xCE82, 0xCE85, 0xCE88, 0xCE89,
    0xCE8B, 0xCE91, 0xCE93, 0xCE95, 0xCE97, 0xCEA1, 0xCEB7, 0xCEE1,
    0xCEE5, 0xCEE9, 0xCEF1, 0xCEF5, 0xCF41, 0xCF45, 0xCF49, 0xCF51,
    0xCF55, 0xCF57, 0xCF61, 0xCF65, 0xCF69, 0xCF71, 0xCF73, 0xCF75,
    0xCFA1, 0xCFA2, 0xCFA5, 0xCFA9, 0xCFB1, 0xCFB3, 0xCFB5, 0xCFB7,
    0xD061, 0xD062, 0xD065, 0xD069, 0xD06E, 0xD071, 0xD073, 0xD075,
    0xD077, 0xD081, 0xD082, 0xD085, 0xD089, 0xD091, 0xD093, 0xD095,
    0xD096, 0xD097, 0xD0A1, 0xD0B7, 0xD0E1, 0xD0E2, 0xD0E5, 0xD0E9,
    0xD0EB, 0xD0F1, 0xD0F3, 0xD0F5, 0xD0F7, 0xD141, 0xD142, 0xD145,
    0xD149, 0xD151, 0xD153, 0xD155, 0xD157, 0xD161, 0xD162, 0xD165,
    0xD169, 0xD171, 0xD173, 0xD175, 0xD176, 0xD177, 0xD181, 0xD185,
    0xD189, 0xD193, 0xD1A1, 0xD1A2, 0xD1A5, 0xD1A9, 0xD1AE, 0xD1B1,
    0xD1B3, 0xD1B5, 0xD1B7, 0xD1BB, 0xD1C1, 0xD1C2, 0xD1C5, 0xD1C9,
    0xD1D5, 0xD1D7, 0xD1E1, 0xD1E2, 0xD1E5, 0xD1F5, 0xD1F7, 0xD241,
    0xD242, 0xD245, 0xD249, 0xD253, 0xD255, 0xD257, 0xD261, 0xD265,
    0xD269, 0xD273, 0xD275, 0xD281, 0xD282, 0xD285, 0xD289, 0xD28E,
    0xD291, 0xD295, 0xD297, 0xD2A1, 0xD2A5, 0xD2A9, 0xD2B1, 0xD2B7,
    0xD2C1, 0xD2C2, 0xD2C5, 0xD2C9, 0xD2D7, 0xD2E1, 0xD2E2, 0xD2E5,
    0xD2E9, 0xD2F1, 0xD2F3, 0xD2F5, 0xD2F7, 0xD341, 0xD342, 0xD345,
    0xD349, 0xD351, 0xD355, 0xD357, 0xD361, 0xD362, 0xD365, 0xD367,
    0xD368, 0xD369, 0xD36A, 0xD371, 0xD373, 0xD375, 0xD377, 0xD37B,
    0xD381, 0xD385, 0xD389, 0xD391, 0xD393, 0xD397, 0xD3A1, 0xD3A2,
    0xD3A5, 0xD3A9, 0xD3B1, 0xD3B3, 0xD3B5, 0xD3B7,
};
/*----------------------------------------------------------------------------*/
/* 기       능 : EBCDIC code to ASCII code conversion table.                  */
/* 인       수 :                                                              */
/*               Index variabled EBCDIC code                                  */
/* 반  환   값 :                                                              */
/*               ASCII code                                                   */
/* 특 이 사 항 :                                                              */
/*----------------------------------------------------------------------------*/
unsigned char Ebcdic2asciiTbl[256] = {
    /* 0x00 - 0x07 */   0x20, 0x01, 0x02, 0x03, 0x20, 0x09, 0x20, 0x7f,
    /* 0x08 - 0x0F */   0x20, 0x20, 0x20, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
    /* 0x10 - 0x17 */   0x10, 0x11, 0x12, 0x13, 0x20, 0x0a, 0x08, 0x20,
    /* 0x18 - 0x1F */   0x18, 0x19, 0x20, 0x20, 0x1c, 0x20, 0x1e, 0x1f,
    /* 0x20 - 0x27 */   0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x17, 0x1b,
    /* 0x28 - 0x2F */   0x20, 0x20, 0x20, 0x20, 0x20, 0x05, 0x06, 0x07,
    /* 0x30 - 0x37 */   0x20, 0x20, 0x16, 0x20, 0x20, 0x20, 0x20, 0x04,
    /* 0x38 - 0x3F */   0x20, 0x20, 0x20, 0x20, 0x14, 0x15, 0x20, 0x1a,
    /* 0x40 - 0x47 */   0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0x48 - 0x4F */   0x20, 0x20, 0xd5, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
    /* 0x50 - 0x57 */   0x26, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0x58 - 0x5F */   0x20, 0x20, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x13,
    /* 0x60 - 0x67 */   0x2d, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0x68 - 0x6F */   0x20, 0x20, 0x1d, 0x2c, 0x25, 0x5f, 0x3e, 0x3f,
    /* 0x70 - 0x77 */   0x5b, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0x78 - 0x7F */   0x20, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
    /* 0x80 - 0x87 */   0x5d, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
    /* 0x88 - 0x8F */   0x68, 0x69, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0x90 - 0x97 */   0x20, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
    /* 0x98 - 0x9F */   0x71, 0x72, 0x7e, 0x7e, 0x20, 0x20, 0x20, 0x20,
    /* 0xa0 - 0xa7 */   0x20, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
    /* 0xa8 - 0xaF */   0x79, 0x7a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0xb0 - 0xb7 */   0x5e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0xb8 - 0xbF */   0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0xc0 - 0xc7 */   0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
    /* 0xc8 - 0xcF */   0x48, 0x49, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0xd0 - 0xd7 */   0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
    /* 0xd8 - 0xdF */   0x51, 0x52, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0xe0 - 0xe7 */   0x5c, 0x20, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
    /* 0xe8 - 0xeF */   0x59, 0x5a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    /* 0xf0 - 0xf7 */   0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
    /* 0xf8 - 0xfF */   0x38, 0x39, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20
}; /* Ebcdic2asciiTbl */
/*----------------------------------------------------------------------------*/
/* 기       능 : ASCII code to EBCDIC code conversion table.                  */
/* 인       수 :                                                              */
/*               Index variabled ASCII code                                   */
/* 반  환   값 :                                                              */
/*               EBCDIC code                                                  */
/* 특 이 사 항 :                                                              */
/*----------------------------------------------------------------------------*/
unsigned char Ascii2ebcdicTbl[0X80] = {
    /* 0x00 - 0x07 */   0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f,
    /* 0x08 - 0x0F */   0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
    /* 0x10 - 0x17 */   0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26,
    /* 0x18 - 0x1F */   0x18, 0x19, 0x3f, 0x27, 0x1c, 0x6a, 0x1e, 0x1f,
    /* 0x20 - 0x27 */   0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d,
    /* 0x28 - 0x2F */   0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
    /* 0x30 - 0x37 */   0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
    /* 0x38 - 0x3F */   0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
    /* 0x40 - 0x47 */   0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
    /* 0x48 - 0x4F */   0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
    /* 0x50 - 0x57 */   0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
    /* 0x58 - 0x5F */   0xe7, 0xe8, 0xe9, 0x70, 0xe0, 0x80, 0xb0, 0x6d,
    /* 0x60 - 0x67 */   0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
    /* 0x68 - 0x6F */   0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
    /* 0x70 - 0x77 */   0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
    /* 0x78 - 0x7F */   0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07
};
/*----------------------------------------------------------------------------*/
/* FUNCTION ID : Ascii2EbcdicStr                                              */
/* 기       능 : ASCII code를 EBCDIC code로 변환.                             */
/* 인       수 :                                                              */
/*               ac_src_data (변환전코드)                                     */
/*               ac_dest_data(변환후코드)                                     */
/*               ai_dest_size(코드길이  )                                     */
/* 반  환   값 :                                                              */
/*               SUCCESS(성공)                                                */
/*               FAIL   (실패)                                                */
/* 특 이 사 항 :                                                              */
/*               SO/SI 처리구분(gi_stype)                                     */
/*                 0 일때 -> SO/SI를 그대로 둔다.                             */
/*                           [aa한글bb] --> [aa한글bb]                        */
/*                 1 일때 -> SO/SI로 한글 앞뒤를 바꾼다.                      */
/*                           [aa한글bb] --> [aO한글Ib]                        */
/*                 2 일때 -> SO/SI를 한글 앞뒤로 Insert한다.                  */
/*                           [aa한글bb] --> [aaO한글Ibb]                      */
/*----------------------------------------------------------------------------*/
int Ascii2EbcdicStr(const unsigned char *ac_src_data, unsigned char *ac_dest_data, int ai_dest_size)
{
    /*------------------------------------------------------------------------*/
    /* 변수 선언.                                                             */
    /*------------------------------------------------------------------------*/
    int      i = 0, j = 0, k = 0, l =0;                    /* Index           */
    int      li_src_size   = 0;                            /* 변환전코드길이  */
    int      li_src_index  = 0;                            /* 변환전코드Index */
    int      li_dest_index = 0;                            /* 변환후코드Index */
    int      li_han_mode   = 0;                            /* 한글모드        */
    int      li_han_len    = 0;                            /* 한글코드길이    */
    int      li_con_len    = 0;                            /* 변환후코드길이  */
    unsigned short ls_char = 0;                            /* Character       */
    char     lc_char;                                      /* 임시변수        */
    /*------------------------------------------------------------------------*/
    /* 변환전코드 길이 Edit.                                                  */
    /*------------------------------------------------------------------------*/
    li_src_size = (int)strlen((const char*)ac_src_data);
    /*------------------------------------------------------------------------*/
    /* ASCII code를 EBCDIC code로 변환.                                       */
    /*------------------------------------------------------------------------*/
    while (li_src_index < li_src_size)
    {
        /*--------------------------------------------------------------------*/
        /* 한글모드에 대한 SO/SI 처리.                                        */
        /*--------------------------------------------------------------------*/
        switch(li_han_mode)
        {
            /*----------------------------------------------------------------*/
            /* English Mode인 경우.                                           */
            /*----------------------------------------------------------------*/
            case ENG_MODE :
                 /*-----------------------------------------------------------*/
                 /* SO/SI 처리.                                               */
                 /*-----------------------------------------------------------*/
                 switch(ac_src_data[li_src_index])
                 {
                     /*-------------------------------------------------------*/
                     /* SO인 경우.                                            */
                     /*-------------------------------------------------------*/
                     case SO :
                          /*--------------------------------------------------*/
                          /* SO를 덧붙이고 한글모드를 Double byte Mode로 설정 */
                          /*--------------------------------------------------*/
                          ac_dest_data[li_dest_index++] = SO;
                          li_src_index++;
                          li_han_mode = KOR_MODE;
                          break;
                     /*-------------------------------------------------------*/
                     /* SI인 경우.                                            */
                     /*-------------------------------------------------------*/
                     case SI :
                          /*--------------------------------------------------*/
                          /* SI를 EBCDIC space 처리.                          */
                          /*--------------------------------------------------*/
                          ac_dest_data[li_dest_index++] = EBC_SPC;
                          li_src_index++;
                          break;
                     /*-------------------------------------------------------*/
                     /* Hangul && Double byte Eng.                            */
                     /*-------------------------------------------------------*/
                     default :
                          /*--------------------------------------------------*/
                          /* Hangul && Double byte English인 경우.            */
                          /*--------------------------------------------------*/
                          if (ac_src_data[li_src_index] > 0xA0)
                          {
                              /*----------------------------------------------*/
                              /* SO로 한글 앞를 바꾼다.                       */
                              /*----------------------------------------------*/
                              if (gi_stype == 1)
                              {
                                  ac_dest_data[li_dest_index-1] = SO;
                                  li_han_len = li_dest_index;
                              }
                              /*----------------------------------------------*/
                              /* SO를 한글 앞에 Insert한다.                   */
                              /*----------------------------------------------*/
                              else if (gi_stype == 2)
                              {
                                  if (ac_dest_data[li_dest_index-1] != SO)
                                  {
                                      ac_dest_data[li_dest_index++] = SO;
                                  }
                                  li_han_len = li_dest_index;
                             }
                             li_han_mode = 1;
                          }
                          /*--------------------------------------------------*/
                          /* English인 경우 2Byte EBCDIC code로 변환.         */
                          /*--------------------------------------------------*/
                          else
                          {
                              ac_dest_data[li_dest_index++] = Ascii2ebcdicTbl[ac_src_data[li_src_index++]];
                          }
                         break;
                 }
                 break;
            /*----------------------------------------------------------------*/
            /* Double byte Mode인 경우.                                       */
            /*----------------------------------------------------------------*/
            case KOR_MODE :
                 /*-----------------------------------------------------------*/
                 /* SO/SI 처리.                                               */
                 /*-----------------------------------------------------------*/
                 switch(ac_src_data[li_src_index])
                 {
                     /*-------------------------------------------------------*/
                     /* SO인 경우.                                            */
                     /*-------------------------------------------------------*/
                     case SO :
                          /*--------------------------------------------------*/
                          /* SO를 EBCDIC space 처리.                          */
                          /*--------------------------------------------------*/
                          ac_dest_data[li_dest_index++] = EBC_SPC;
                          li_src_index++;
                          break;
                     /*-------------------------------------------------------*/
                     /* SI인 경우.                                            */
                     /*-------------------------------------------------------*/
                     case SI :
                          /*--------------------------------------------------*/
                          /* SI를 덧붙이고 한글모드를 English Mode로 설정.    */
                          /*--------------------------------------------------*/
                          ac_dest_data[li_dest_index++] = SI;
                          li_src_index++;
                          li_han_mode = ENG_MODE;
                          break;
                     /*-------------------------------------------------------*/
                     /* Etc.                                                  */
                     /*-------------------------------------------------------*/
                     default :
                          /*--------------------------------------------------*/
                          /* Hangul && Double byte eng가 아닌 경우.           */
                          /*--------------------------------------------------*/
                          if (ac_src_data[li_src_index] < 0xA1)
                          {
                              /*----------------------------------------------*/
                              /* SI로 한글 뒤를 바꾼다.                       */
                              /*----------------------------------------------*/
                              if (gi_stype == 1)
                              {
                                  ac_dest_data[li_dest_index++] = SI;
                                  li_src_index++;
                              }
                              /*----------------------------------------------*/
                              /* SI를 한글 뒤로 Insert한다.                   */
                              /*----------------------------------------------*/
                              else if (gi_stype == 2)
                              {
                                  if (ac_src_data[li_src_index+1] != SI)
                                  {
                                      ac_dest_data[li_dest_index++] = SI;
                                  }
                                  ac_dest_data[li_dest_index++] = Ascii2ebcdicTbl[ac_src_data[li_src_index++]];
                              }
                              li_han_mode = ENG_MODE;
                          }
                          /*--------------------------------------------------*/
                          /* Hangul && Double byte eng인 경우.                */
                          /*--------------------------------------------------*/
                          else
                          {
                              /*----------------------------------------------*/
                              /* English code to IBM Hangul code conversion.  */
                              /*----------------------------------------------*/
                              if ((ac_src_data[li_src_index] > 0xA0) && (ac_src_data[li_src_index] < 0xB0))
                              {
                                  ls_char = (ac_src_data[li_src_index++] - 0xA1) * 96; /* offset */
                                  ls_char += ac_src_data[li_src_index++] - 0xA1;
                                  ls_char = Engdbl2ibmTbl[ls_char];
                                  ac_dest_data[li_dest_index++] = HIGHBYTE(ls_char);
                                  ac_dest_data[li_dest_index++] = LOWBYTE(ls_char);
                              }
                              /*----------------------------------------------*/
                              /* KS Hangul code to IBM Hangul code conversion */
                              /*----------------------------------------------*/
                              else
                              {
                                  ls_char = (ac_src_data[li_src_index++] - 0xB0) * 94; /* offset */
                                  ls_char += ac_src_data[li_src_index++] - 0xA1;
                                  ls_char = Ksc2ibmTbl[ls_char];
                                  ac_dest_data[li_dest_index++] = HIGHBYTE(ls_char);
                                  ac_dest_data[li_dest_index++] = LOWBYTE(ls_char);
                              }
                          }
                          break;
                 }
                 break;
        }
    }
    /*------------------------------------------------------------------------*/
    /* 변환타입이 1(SO/SI를 그대로 둔다)이고 한글모드가 English인 경우.       */
    /*------------------------------------------------------------------------*/
    if (gi_stype && li_han_mode)
    {
        ac_dest_data[li_dest_index++] = SI;
    }
    /*------------------------------------------------------------------------*/
    /* 변환후코드 길이와 변환할 코드길이가 다른 경우 제일뒤에 Null처리.       */
    /*------------------------------------------------------------------------*/
    if (li_dest_index > ai_dest_size)
    {
        ac_dest_data[li_dest_index] = ASC_NULL;
        return (-1);
    }
    /*------------------------------------------------------------------------*/
    /* 변환후코드 길이가 변환할 길이보다 작은 경우 나머지를 EBCDIC Spacec처리 */
    /*------------------------------------------------------------------------*/
    for(; li_dest_index < ai_dest_size; li_dest_index++)
    {
        ac_dest_data[li_dest_index] = EBC_SPC;
    }
    return(li_dest_index);
}
/*----------------------------------------------------------------------------*/
/* FUNCTION ID : Ebcdic2AsciiStr                                              */
/* 기       능 : EBCDIC code를 ASCII code로 변환.                             */
/* 인       수 :                                                              */
/*               ac_src_data (변환전코드)                                     */
/*               ac_dest_data(변환후코드)                                     */
/*               ai_dest_size(코드길이  )                                     */
/* 반  환   값 :                                                              */
/*               SUCCESS(성공)                                                */
/*               FAIL   (실패)                                                */
/* 특 이 사 항 :                                                              */
/*               SO/SI 처리구분(gi_rtype)                                     */
/*                 0 일때 -> SO/SI를 그대로 둔다(Exit).                       */
/*                 1 일때 -> SO/SI를 ASCII blank로 바꾼다.                    */
/*                 2 일때 -> SO/SI를 삭제한다.                                */
/*               주의) source string에 SO/SI가 포함하고 있어야 한다.          */
/*----------------------------------------------------------------------------*/
int Ebcdic2AsciiStr(const unsigned char * ac_src_data, unsigned char* ac_dest_data, int ai_dest_size)
{
    /*------------------------------------------------------------------------*/
    /* 변수 선언.                                                             */
    /*------------------------------------------------------------------------*/
    int      i = 0, j = 0, k = 0, l = 0;                   /* Index           */
    int      li_src_size   = 0;                            /* 변환전코드길이  */
    int      li_src_index  = 0;                            /* 변환전코드Index */
    int      li_dest_index = 0;                            /* 변환후코드Index */
    int      li_han_mode   = 0;                            /* 한글모드        */
    int      li_found_tbl  = 0;                            /* Index           */
    int      li_max        = 0;                            /* 최대값          */
    int      li_min        = 0;                            /* 최소값          */
    int      li_pivot      = 0;                            /* Pivot           */
    unsigned short ls_pivot_val = 0;                       /* Pivot value     */
    unsigned short ls_char      = 0;                       /* Character       */
    unsigned short ls_offset    = 0;                       /* Offset          */
    unsigned short ls_sgmt      = 0;                       /* Segment         */
    char     lc_char;                                      /* 임시변수        */
    /*------------------------------------------------------------------------*/
    /* 변환전코드 길이 Edit.                                                  */
    /*------------------------------------------------------------------------*/
    li_src_size = strlen((const char*)ac_src_data);
    /*------------------------------------------------------------------------*/
    /* EBCDIC code를 ASCII code로 변환.                                       */
    /*------------------------------------------------------------------------*/
    while(li_src_index < li_src_size)
    {
        /*--------------------------------------------------------------------*/
        /* 한글모드에 대한 SO/SI 처리.                                        */
        /*--------------------------------------------------------------------*/
        switch(li_han_mode)
        {
            /*----------------------------------------------------------------*/
            /* English Mode인 경우.                                           */
            /*----------------------------------------------------------------*/
            case ENG_MODE :
                 /*-----------------------------------------------------------*/
                 /* SO/SI 처리.                                               */
                 /*-----------------------------------------------------------*/
                 switch(ac_src_data[li_src_index])
                 {
                     /*-------------------------------------------------------*/
                     /* SO인 경우.                                            */
                     /*-------------------------------------------------------*/
                     case SO :
                          /*--------------------------------------------------*/
                          /* SO를 덧붙인다.                                   */
                          /*--------------------------------------------------*/
                          if (gi_rtype == 0)
                          {
                              ac_dest_data[li_dest_index++] = SO;
                          }
                          /*--------------------------------------------------*/
                          /* SO를 ASCII Space로 변경한다.                     */
                          /*--------------------------------------------------*/
                          else if (gi_rtype == 1)
                          {
                              ac_dest_data[li_dest_index++] = ASC_SPC;
                          }
                          li_src_index++;
                          li_han_mode = KOR_MODE;
                          break;
                     /*-------------------------------------------------------*/
                     /* SI인 경우.                                            */
                     /*-------------------------------------------------------*/
                     case SI :
                          /*--------------------------------------------------*/
                          /* SI를 ASCII Space로 변경한다.                     */
                          /*--------------------------------------------------*/
                          ac_dest_data[li_dest_index++] = ASC_SPC;
                          li_src_index++;
                          break;
                     /*-------------------------------------------------------*/
                     /* English인 경우.                                       */
                     /*-------------------------------------------------------*/
                     default :
                          /*--------------------------------------------------*/
                          /* EBCDIC code를 ASCII code로 변환.                 */
                          /*--------------------------------------------------*/
                          ac_dest_data[li_dest_index++] = Ebcdic2asciiTbl[ac_src_data[li_src_index++]];
                          break;
                 }
                 break;
            /*----------------------------------------------------------------*/
            /* Hangu Mode인 경우.                                             */
            /*----------------------------------------------------------------*/
            case KOR_MODE :
                 /*-----------------------------------------------------------*/
                 /* EBCDIC code를 ASCII code로 변환.                          */
                 /*-----------------------------------------------------------*/
                 switch(ac_src_data[li_src_index])
                 {
                     /*-------------------------------------------------------*/
                     /* SO인 경우.                                            */
                     /*-------------------------------------------------------*/
                     case SO :
                          /*--------------------------------------------------*/
                          /* SO를 ASCII Space로 변경한다.                     */
                          /*--------------------------------------------------*/
                          ac_dest_data[li_dest_index++] = ASC_SPC;
                          li_src_index++;
                          break;
                     /*-------------------------------------------------------*/
                     /* SO인 경우.                                            */
                     /*-------------------------------------------------------*/
                     case SI :
                          /*--------------------------------------------------*/
                          /* SI를 덧붙인다.                                   */
                          /*--------------------------------------------------*/
                          if (gi_rtype == 0)
                          {
                              ac_dest_data[li_dest_index++] = SI;
                          }
                          /*--------------------------------------------------*/
                          /* SI를 ASCII Space로 변경한다.                     */
                          /*--------------------------------------------------*/
                          else if (gi_rtype == 1)
                          {
                              ac_dest_data[li_dest_index++] = ASC_SPC;
                          }
                          li_src_index++;
                          li_han_mode = ENG_MODE;
                          break;
                     /*-------------------------------------------------------*/
                     /* 0x20인 경우.                                          */
                     /*-------------------------------------------------------*/
                     case 0x20 :
                          ac_dest_data[li_dest_index++] = 0xA1;
                          li_src_index++;
                          break;
                     /*-------------------------------------------------------*/
                     /* 0x40인 경우.                                          */
                     /*-------------------------------------------------------*/
                     case 0x40 :
                          ac_dest_data[li_dest_index++] = 0xA1;
                          li_src_index++;
                          break;
                     /*-------------------------------------------------------*/
                     /* Double byte Eng인 경우.                               */
                     /*-------------------------------------------------------*/
                     case 0x42 :
                          /*--------------------------------------------------*/
                          /* EBCDIC code를 ASCII code로 변환.                 */
                          /*--------------------------------------------------*/
                          ac_dest_data[li_dest_index++] = 0xA3;
                          li_src_index++;
                          ac_dest_data[li_dest_index++] = Ebcdic2asciiTbl[ac_src_data[li_src_index++]] | 0x80;
                          break;
                     /*-------------------------------------------------------*/
                     /* Hangul && 2byte dbcs인 경우.                          */
                     /*-------------------------------------------------------*/
                     default :
                          /*--------------------------------------------------*/
                          /* Character set Edit.                              */
                          /*--------------------------------------------------*/
                          ls_char  = (unsigned short)(ac_src_data[li_src_index++] << 8);
                          ls_char |= ac_src_data[li_src_index++];
                          li_max   = 2350; li_min = 0;
                          /*--------------------------------------------------*/
                          /* Hangul conversion.                               */
                          /*--------------------------------------------------*/
                          do {
                              /*----------------------------------------------*/
                              /* KS Hangul code to IBM Hangul code conversion */
                              /*----------------------------------------------*/
                              li_pivot     = (int)((li_max + li_min) / 2);
                              ls_pivot_val = Ksc2ibmTbl[li_pivot];
                              /*----------------------------------------------*/
                              /* IBM Hangul code의 Offset과 Segment Edit.     */
                              /*----------------------------------------------*/
                              if (ls_pivot_val == ls_char)
                              {
                                  ls_offset = (unsigned short)(li_pivot / 94);
                                  ls_sgmt   = (unsigned short)(li_pivot % 94);
                                  ac_dest_data[li_dest_index++] = (unsigned char)(0xB0 + ls_offset);
                                  ac_dest_data[li_dest_index++] = (unsigned char)(0xA1 + ls_sgmt  );
                                  break;
                              }
                              /*----------------------------------------------*/
                              /* 최대값 Edit.                                 */
                              /*----------------------------------------------*/
                              if (ls_char < ls_pivot_val)
                              {
                                  li_max = li_pivot - 1;
                              }
                              /*----------------------------------------------*/
                              /* 최소값 Edit.                                 */
                              /*----------------------------------------------*/
                              else
                              {
                                  li_min = li_pivot + 1;
                              }
                              /*----------------------------------------------*/
                              /* Hangul conversion.                           */
                              /*----------------------------------------------*/
                              if (li_max < li_min)
                              {
                                  /*------------------------------------------*/
                                  /* 코드변환할 테이블의 인덱스.              */
                                  /*------------------------------------------*/
                                  li_found_tbl = 0;
                                  /*------------------------------------------*/
                                  /* English -> IBM Hangul code conversion.   */
                                  /*------------------------------------------*/
                                  for(i = 0; i < (96 * 12); i++)
                                  {
                                      /*--------------------------------------*/
                                      /* English->IBM Hangul code conversion. */
                                      /*--------------------------------------*/
                                      ls_pivot_val = Engdbl2ibmTbl[i];
                                      /*--------------------------------------*/
                                      /* IBM 한글코드의 Offset과 Segment Edit */
                                      /*--------------------------------------*/
                                      if (ls_pivot_val == ls_char)
                                      {
                                          li_found_tbl++;
                                          ls_offset = (unsigned char)(i / 96);
                                          ls_sgmt   = (unsigned char)(i % 96);
                                          ac_dest_data[li_dest_index++] = (unsigned char)(0xA1 + i / 96);
                                          ac_dest_data[li_dest_index++] = (unsigned char)(0xA1 + i % 96);
                                          break;
                                      }
                                  }
                                  if (li_found_tbl == 0)
                                  {
                                      ac_dest_data[li_dest_index++] = 0xA1;
                                      ac_dest_data[li_dest_index++] = 0xA1;
                                  }
                                  break;
                              }
                          } while(1);
                          break;
                 }
                 break;
        }
    }
    /*------------------------------------------------------------------------*/
    /* English Mode인 경우.                                                   */
    /*------------------------------------------------------------------------*/
    if (li_han_mode)
    {
        /*--------------------------------------------------------------------*/
        /* SO를 덧붙인다.                                                     */
        /*--------------------------------------------------------------------*/
        if (gi_rtype == 0)
        {
            ac_dest_data[li_dest_index++] = SI;
        }
        /*--------------------------------------------------------------------*/
        /* SO를 ASCII Space로 변경한다.                                       */
        /*--------------------------------------------------------------------*/
        else if (gi_rtype == 1)
        {
            ac_dest_data[li_dest_index++] = ASC_SPC;
        }
        li_han_mode = ENG_MODE;
    }
    /*------------------------------------------------------------------------*/
    /* 변환후코드 길이가 변환할 길이보다 작은 경우 나머지를 ASC Spacec 처리.  */
    /*------------------------------------------------------------------------*/
    for(; li_dest_index < ai_dest_size; li_dest_index++)
    {
        ac_dest_data[li_dest_index] = ASC_SPC;
    }
    /*------------------------------------------------------------------------*/
    /* 변환후코드 반환.                                                       */
    /*------------------------------------------------------------------------*/
    return(li_dest_index);
}
/*----------------------------------------------------------------------------*/
/*             C O N V L A N G                         S T A R T              */
/*----------------------------------------------------------------------------*/
int main(int argc, char *argv[])
{
    /*------------------------------------------------------------------------*/
    /* 변수 선언.                                                             */
    /*------------------------------------------------------------------------*/
    int     i = 0, j = 0, k = 0;                           /* Index           */
    FILE   *fp1, *fp2;                                     /* File pointer    */
    char    lc_fgets_data[4000];                           /* fgets data      */
    char    lc_src_data[4000];                             /* Source data     */
    char    lc_des_data[4000];                             /* Desc data       */
    /*------------------------------------------------------------------------*/
    /* 변수 초기화.                                                           */
    /*------------------------------------------------------------------------*/
    memset(lc_fgets_data, 0x00, sizeof(lc_fgets_data));    /* fgets data      */
    memset(lc_src_data  , 0x00, sizeof(lc_src_data  ));    /* Source data     */
    memset(lc_des_data  , 0x00, sizeof(lc_des_data  ));    /* Desc data       */

    printf("Program Starting.........\n");
    /*------------------------------------------------------------------------*/
    /* Inquiry Date Edit.                                                     */
    /*------------------------------------------------------------------------*/
    if (argc != 5)
    {
        printf("Error : 코드변환하기 위한 Argument를 입력해야 한다. \n");
        printf("Usage : <Source 파일명> <Target 파일명> <변환구분> <SO/SI 처리구분>\n");
        exit(-1);
    }
    /*------------------------------------------------------------------------*/
    /* Source 파일명 Edit.                                                    */
    /*------------------------------------------------------------------------*/
    if (argv[1] == 0x00)
    {
        printf("Error : Source 파일명은 반드시 입력해야 한다. \n");
        exit(-1);
    }
    printf("File name(Source) = [%s]\n", argv[1]);
    /*------------------------------------------------------------------------*/
    /* Source 파일명 Edit.                                                    */
    /*------------------------------------------------------------------------*/
    if (argv[2] == 0x00)
    {
        printf("Error : Target 파일명은 반드시 입력해야 한다. \n");
        exit(-1);
    }
    printf("File name(Target) = [%s]\n", argv[2]);
    /*------------------------------------------------------------------------*/
    /* 변환구분 Edit.                                                         */
    /*------------------------------------------------------------------------*/
    if (argv[3] == 0x00)
    {
        printf("Error : 변환구분은 반드시 입력해야 한다. \n");
        exit(-1);
    }
    printf("Trans Type = [%s]\n", argv[3]);
    /*------------------------------------------------------------------------*/
    /* SO/SI 처리구분 Edit.                                                   */
    /*------------------------------------------------------------------------*/
    if (argv[4] == 0x00)
    {
        printf("Error : 변환구분은 반드시 입력해야 한다. \n");
        exit(-1);
    }
    else
    {
        if (strncmp(argv[3], "E", 1) == 0)
        {
            gi_stype = atoi(argv[4]);
        }
        else
        {
            gi_rtype = atoi(argv[4]);
        }
    }
    printf("SO/SI Type = [%s-%d-%d]\n", argv[4], gi_stype, gi_rtype);
    /*------------------------------------------------------------------------*/
    /* SAM file open(Source).                                                 */
    /*------------------------------------------------------------------------*/
    if ((fp1 = fopen(argv[1], "r")) == NULL)
    {
        printf("Error : %s(%s). \n", strerror(errno), argv[1]);
        exit(-1);
    }
    printf("File open = [%s]\n", argv[1]);
    /*------------------------------------------------------------------------*/
    /* SAM file open(Target).                                                 */
    /*------------------------------------------------------------------------*/
    if ((fp2 = fopen(argv[2], "w")) == NULL)
    {
        fclose(fp1);
        printf("Error : %s(%s). \n", strerror(errno), argv[2]);
        exit(-1);
    }
    printf("File open = [%s]\n", argv[2]);
    /*------------------------------------------------------------------------*/
    /* 코드 변환할 Data를 읽음.                                               */
    /*------------------------------------------------------------------------*/
    while(fgets(lc_fgets_data, 4000, fp1) != NULL)
    {
        /*--------------------------------------------------------------------*/
        /* 변환할 데이터 Edit.                                                */
        /*--------------------------------------------------------------------*/
        strncpy(lc_src_data, lc_fgets_data, strlen(lc_fgets_data)-1);

        printf("Trans data(before) = [%d-%s]\n", strlen(lc_src_data), lc_src_data);
        /*--------------------------------------------------------------------*/
        /* ASCII 코드를 EBCDIC 코드로 변환인 경우.                            */
        /*--------------------------------------------------------------------*/
        if (strncmp(argv[3], "E", 1) == 0)
        {
            /*----------------------------------------------------------------*/
            /* ASCII 코드를 EBCDIC 코드로 변환.                               */
            /*----------------------------------------------------------------*/
            Ascii2EbcdicStr((const char *)lc_src_data, lc_des_data,strlen(lc_src_data));
        }
        /*--------------------------------------------------------------------*/
        /* EBCDIC 코드를 ASCII 코드로 변환인 경우.                            */
        /*--------------------------------------------------------------------*/
        else
        {
            /*----------------------------------------------------------------*/
            /* EBCDIC 코드를 ASCII 코드로 변환.                               */
            /*----------------------------------------------------------------*/
            Ebcdic2AsciiStr((const char *)lc_src_data, lc_des_data,strlen(lc_src_data));
        }
        printf("Trans data(after) = [%d-%s]\n", strlen(lc_des_data), lc_des_data);
        /*--------------------------------------------------------------------*/
        /* 코드변환한 데이터를 저장.                                          */
        /*--------------------------------------------------------------------*/
        fputs(lc_des_data, fp2);
        fputs("\n", fp2);
        /*--------------------------------------------------------------------*/
        /* 변수 초기화.                                                       */
        /*--------------------------------------------------------------------*/
        memset(lc_fgets_data, 0x00, sizeof(lc_fgets_data));/* fgets data      */
        memset(lc_src_data  , 0x00, sizeof(lc_src_data  ));/* Source data     */
        memset(lc_des_data  , 0x00, sizeof(lc_des_data  ));/* Des data        */
    }
    printf("Program End.........\n");
    /*------------------------------------------------------------------------*/
    /* SAM file close.                                                        */
    /*------------------------------------------------------------------------*/
    fclose(fp1); fclose(fp2);
    exit(0);
}
/*----------------------------------------------------------------------------*/
/*             C O N V L A N G                         E N D                  */
/*----------------------------------------------------------------------------*/