/* *********************************************************** Program : Hangul Code Conversion Program Author : June-Yub Lee (jylee@math1.nyu.edu:jylee@math1.kaist.ac.kr) Created : Feb, 29, 1992 ( 1.1 ) Syntax : hcode -[Iknt[iKnrst]] [ input_file(-) [output_file] ] ************************************************************ */ Description: ----------- Flexible : you can put new hangul code without touching the program. Efficient : at least in my view point :-). Simple : total line of the program is about 300 lines(except data). Non Interactive : you can't use it as a terminal input filter. Hangul Code Conversion program. Version: -------- 1.0 (Jan, 07, 1992) 1.1 (Feb, 29, 1992) . Now support O-2022 for both input and output code. . So I should change output code nput eyboard as imulation ey_input. Copyright: ---------- This Program is free software under the GNU General Public License. If you are installing this program for your own work or other users, please send me a e-mail so that I can fix any possible bug and update for new Hangul Code including UNICODE. Supported Hangul Code: ---------------------- This program converts any possible Hangul code to another. Now it supports ISO-2022, KS-5601, Trigem_Johap & N-Byte Hangul code as input. Roman_Writing_for_KS & Simulation_Key_Typing_Code as well as above for output. _.iLeon_ _HanGeul_ _ChulLyeog.eun_ dumb terminal _.eSeoDo_ _BolSu.issJi.yu_ How to insert a new hangul code: -------------------------------- Moreover you can include ANY HANGUL CODE WITHOUT TOUCHING THE PROGRAM. Just insert your hangul code at the corresponding lines in h2Bcode.h (h3Bcode.h) if it is 2Byte(Multi-Byte Hangul). And then define the name of code in hcode.h modify in(out)_choice. (cf) basically Input Hangul code must be sorted with order of KSC. Routines You may want to use for another Hangul Application : ------------------------------------------------------------- To convert between 2 byte Hangul in Hanbuf. void code2conv(HanBuf,inCode,outCode) 2 Byte Hangul Data : int Hanbuf[] To get 2 Byte Johap Hangul from Multi-byte hangul. void m2code(buf,IC,HanMode,Hanbuf) int getOne(buf, IC, p0, p1) int HanCode(buf,IC, p0,p1,p2,p3) Multi-byte Hangul Input Buffer : unsigned char buf[] Multi-byte Hangul Code : int IC 2 byte Hangul Output Buffer : int Hanbuf[] HanMode, and p0-p3 See Program. Multi-Byte Hangul Char Automata: -------------------------------- Hangul Char in Multi-byte is defined like (C* V+ C*) (C V+ C*)* (C* V* EOF) Pointer p0 p1 p2 p3 Next_Step p0 p1 p2 p3 Known Bug: ---------- 1. More complicate hangul automata can deal "impossible_hanguls" better. for example. Vowel Vowel ... Or Consonant Consonant ... sequence 2. In KSC input, characters starting with 0xA4,0xB0-0xC8 is supposed a KSC char. In Trigem input, characters starting with MSB set is supposed a Trigem char. In multi-Byte input, characters between Start and End code should be hangul. 3. Starting and Ending code will be inserted automatically before and after Uncompleted hangul (only ChoSung or only JungSung) code when output. 4. For ISO-2022 output, the program puts the starting escape sequence at the beginning of output, so the output file by "hcode -ii" may be different from the input file. 5. Error Situation when ISO input, for example missing Ending code, Oddnumber chars between starting and ending code, doesn't exit. How to get and install the program: ----------------------------------- 1 document : hcode.doc 2 program : hcode.c, conv.c 3 head files : hcode.h, h2Bcode.h, h3Bcode.h ftp:anonymous@cair.kaist.ac.kr:/pub/hangul/codeconv/hcode1.1.tar.Z ftp:anonymous@kythera.nmsu.edu:/pub/korean/hcode1.1.tar.Z Or set me a e-mail I will send you it via e-mail with shar format. Then compile by "cc -o hcode hcode.c conv.c". The excutable code is stand alone application. Good luck. Any comment and bug reported will be appreciated. Thanks for every people to work for non-commercial Hangul Programs.