lotus

previous page: 2.What kind of Hangul terminal emulators are avaiable?
  
page up: Hangul & Internet in Korea FAQ
  
next page: 4. How can I use Hangul under MS-DOS/MS-Windows and OS/2?

3. How can I edit Hangul documents?




Description

This article is from the Hangul & Internet in Korea FAQ, by Jungshik Shin jshin@minerva.cis.yale.edu with numerous contributions by others.

3. How can I edit Hangul documents?

On Unix host, there are a few editors for Hangul. To edit Hangul file with
any of these editors, you have to set terminal 8bit-clean. See Subject 16

Mule is a Multilingual Extension to the GNU Emacs. Mule 1.0 and 2.x are
based on Emacs ver.18 and have superceded Nemacs(Nippon Emacs?).
[Contribution by Choi,Woohyung]. Mule 2.3 is still widely used in and
outside Japan, but the release of GNU Emacs 20 with Mule features included
by default made Mule 2.3 (based on Emacs 18.x) obsolete. I recommend
everyone still using Mule 2.3 upgrade to GNU Emacs 20 or Hanemacs(based on
GNU Emacs 19.3x).

As mentioned above, GNU Emacs 20 (the newest is 20.2) includes all the
features added by Mule development team and is truly multilinguial. You have
to get three files, emacs-M.N.tar.gz, leim-M.N.tar.gz(for Hangul input)
and intlfonts.tar(that includes Hangul X fonts contributed to X consortium
by Daewoo. You don't need to get this file if you already have Daewoo and
other Hangul X11 fonts and are not interested in languages other than those
covered by iso-8859-1 and Korean. See Subject 6 for details on Hangul X11
fonts) where M is 20(or larger) and N is 2 for the newest version as of
Ocotober, 1997. All three of these files are available at the GNU archive(
ftp://ftp.prep.ai.mit.edu/pub/gnu/ is the original site and there are a
number of mirrors around the world including KREONET archive and CAIR
archive in Korea). If Hangul characters are displayed as hollow boxes,
invoke emacs with "-fn fontset-standard" option. Please, note that you need
to press CTRL-\(instead of more familiar shift-space) to toggle input method
between Hangul and English. If invoked with '-nw' option from within hanterm
and other hangul terminal emulators for MS-Windows and Mac, you can use
shift-space(or whatever your terminal emulator uses to switch between Hangul
and English).

A mixture of successes and failures have been reported as to using Hangul
Input Method offered by X11 instead of leim included in GNU Emacs 20. HP/UX
10.x(if terminal-coding-system is set to euc-kr) seems to sort of work, but
Linux and Digital Unix don't work well. According to Chung, Jae-youn at
crisp@hugsvr.kaist.ac.kr, XEmacs under Solaris 2.5 reportedly(not confirmed)
works well with X Input Method(htt or is).

It'd be a good idea to add the following lines(posted by Choi, Jun-Ho at
junker@jazz.snu.ac.kr) to your X resource file(e.g. ~/.Xdefaults or
~/.Xresources) to avoid the hassle of designating the fontset in command
line(i.e. invoking emacs with 'emacs -fn fontset-standard'). You need to
customize this to make it suitable for your environment (Hangul fonts you
have and the resolution of your X display, etc).

Emacs.Font: *-fontset-standard
Emacs.Fontset-0: -misc-fixed-medium-r-normal-*-12-120-*-*-m-60-fontset-6,\
korean-ksc5601:-hanyang-kodig-medium-r-normal--12-120-*-ksc5601*-*
Emacs.Fontset-1: -*-courier-medium-r-normal-*-12-120-*-*-m-70-fontset-7,\
korean-ksc5601:-hanyang-kodig-medium-r-normal--14-140-*-ksc5601*-*,\
japanese-jisx0208:-misc-fixed-medium-r-normal--14-*-jisx0208*-*

XEmacs(formerly Lucid Emacs) 20 also includes Mule features, but its
multilinguial support is a little bit behind that of GNU Emacs 20.

FAQ for Mule(which unfortunately doesn't reflect recent changes in GNU Emacs
20/Mule) is available in http://www.etl.go.jp/~mule/. (Korean translation of
Mule FAQ is also available at the same site). For the up-to-date information
on Emacs 20(Mule), you may wish to subscribe to Mule mailing list by sending
a message with 'subscribe' in the message body to mule-request@etl.go.jp.

Detailed instruction for setting Mule 2.x for Hangul is found in
hlatex-guide.ps at CTAN archives and CAIR archive along with HLaTeX 0.9xe
distribution. Without installing HLaTeX 0.9xe, it can be printed out with
any postscript printer or non-PS printer and ghostscript See Subject 11 for
HLaTeX.

GNU Emacs 20.0.x needs different settings to use Hangul. You may add
following lines to ~/.emacs if you use it primarily for Korean. [Sent to
Mule-mailing list by Kim, Deogtae at dtkim@camars.kaist.ac.kr]

(set-language-environment "Korean")
;;(load-library "korean") ;; this doesn't seem to be necessary in Emacs 20.x

;; Remove comment if you want to use three set keyboard, instead
;; (select-input-method "Korean" "korean-hangul3")
;; Or better is use the following line
;; (setq default-korean-keyboard "3")

(setq-default file-name-coding-system 'euc-kr)

;;; Interactive setting of clipboard coding system.
;; This should be included in standard emacs lisp package.

(defun set-clipboard-coding-system (user-coding-system)
"Set `clipboard-coding-system' for communicating with other X clients.
When sending or receiving text via cut_buffer, selection, and clipboard,
the text is encoded or decoded by this coding system.
A default value is `iso-latin-1'"
(interactive "zClipboard coding system: ")
(setq clipboard-coding-system user-coding-system))

;; Proper copy and paste with other windows in window environment
(set-clipboard-coding-system 'euc-kr)

;; In Emacs 20.3, use the following instead for cut and paste in EUC-KR
;; (per Chung jae youn jay@pllab.kaist.ac.kr)
(set-selection-coding-system 'euc-kr)

;; To use Shift-Space instead of CTRL-\
;; to toggle input methods in window environment
(global-set-key [?\S- ] 'toggle-input-method)

;; these lines are necessary for those who use Emacs/Mule in terminal
;; environment such as Hanterm and other Hangul terminal emulators running
;; under MS-Windows and Mac with '-nw' option

(if (and (null window-system) (null noninteractive))
(progn
(set-keyboard-coding-system 'euc-kr)
(set-terminal-coding-system 'euc-kr)))

;; Hangul Mail setting
(setq sendmail-coding-system 'euc-kr)
;; Hangul Usenet Newsgroup setting
(gnus-mule-add-group "han" 'euc-kr)

For further details on mail and news related settings, see Subject 9 and
Subject 24, respectively.

Mule(rather,it has to be called GNU Emacs now that GNU Emacs has accomodated
all the enhancements of Mule) has been in active development and necessary
Hangul(acutally language setting) setting may vary from version to version
until sort of stabilized version comes out perhaps in late 1997.
Accordingly, what I include here(pros and cons, bugs, configuration, etc)
may or may not be applied to a specific version of Emacs/Mule. What follows
has to be added to site-start.el (if you have root previlege) or ~/.emacs as
an ordinary user.

Mule 2.3 has been ported to Windows 95/NT and you can use Hangul in
Korean/Japanese(and perhaps Chinese/Taiwanese) Windows 95/NT with it. For
details, see http://www.nkgw.elec.keio.ac.jp/~han/, Han, Jeonghoon's web
page. There are a couple of other solutions(which seem to be better) based
on Emacs 20.x. See http://calab.kaist.ac.kr/~dtkim/java/tools/emacs.html.

In early 1995, Hangul-aware Emacs was released by Kim,Kang-hee(at
khkim@archi.snu.ac.kr) and it's available in /hangul/editor/HanEmacs at CAIR
Archive and major Hangul archives. There are two versions of them, one based
on GNU emacs( hanemacs-gnu-0.99) and the other( hanemacs-lucid-1.0) based on
Lucid Emacs. The most recent version with enhanced JOHAB encoding handling
and Hanja conversion is 2.1 (based on GNU Emacs 19.30) released in May, 1996
and available at CAIR archive and SUNsite Korea.
kisskiss@soback.kornet.ne.kr compared GNU Emacs 19.30 and HanEmacs 2.1 and
applied patches to convert the former to the latter to GNU Emacs 19.34 to
enable Hangul I/O in GNU Emacs 19.34. The author of HanEmacs merged the
change and released HanEmacs 19.34 on August, 25, 1997. It's available as
hanemacs-19.34.tar.gz in the same place as HanEmacs 2.1.

For Hanemacs 19.34, you might have to add the following lines to .emacs in
your home directory(or in compile time, you can add it to site-init.el)
[posted to han.comp.os.linux by Choi Jun Ho at junker@jazz.snu.ac.kr]

(cond
((and
(boundp 'emacs-major-version)
(= emacs-major-version 19)
(= emacs-minor-version 34))
(standard-display-european t)
(set-input-mode (car (current-input-mode)) (nth 1 (current-input-mode)) 0)))

There is another emacs patched for Hangul. It's patched for Japanese first
and called nemacs. A little patch to nemacs 3.3(available at CAIR archive)
made possible using Hangul. Nemacs is old and has been superceded by Mule,
so that you'd better use Mule or Hanemacs, instead. [Contribution by
Choi,Woohyung]

A trouble with these patched version of Emacs or GNU Emacs 20.x is that
they're so huge(at least 10 MB) that you may not install it without
permission of the system administrator at your site. There's a way, however,
to use Hangul in GNU Emacs prior to 20.x(perhaps in Lucid Emacs(now
XEmacs),too). Add following lines to '.emacs' in your home directory and
you'll be able to use Hangul with ordinary Emacs when launched inside
Hanterm or other Hangul emulator(See Subject 2) with '-nw'(no window) option
to emacs. Be aware that you have to bear with some inconvenience(e.g. a
single Hangul syllable requires two key strokes to delete) using this
method.

(standard-display-european t)
(require 'iso-insert)
(require 'iso-syntax)
(standard-display-8bit 160 255)
(set-input-mode (car (current-input-mode))
(nth 1 (current-input-mode)) 0)

[Quoted from Hangul Linux-help mailing list digest by Lee,Jong-hyuk at
wings@baram.kaist.ac.kr. Probablely, original contribution by Kim,Daeshik at
dkim@cwc.com]

A far better way to use Hangul in GNU Emacs prior to version 20 (invoked
with '-nw' option from within Hangul terminal emulator : See Subject 2) is
install ksc.5601.el in your home directory and put following lines in
~/.emacs.

(if (and (null window-system) (null noninteractive))
(progn
(load-library "~/ksc5601.el")
(standard-display-ksc5601 t)
(substitute-key-definition
'backward-delete-char-untabify
'ksc5601-backward-delete-char-untabify
lisp-interaction-mode-map)))

ksc5601.el was made by Deoktae Kim(dtkim@camars.kaist.ac.kr) at KAIST and is
currently available at
ftp://hugsvr.kaist.ac.kr/pub/elisp/incoming/. [Contribution by
Chung Jae-youn at crisp@hugsvr.kaist.ac.kr]

Some people managed to use GNU Emacs 20 with the Hangul Input Method server
for X window instead of "built-in" input mechanism. In HP/UX 10.x, Chung,
Jae-youn succeeded in connecting Emacs to Hangul Input method server by
setting terminal-coding-system to euc-kr. Needless to say, the environment
variable XMODIFIERS should be to set to "@im=input_server_name". Under
Digital Unix 4.x, Emacs 20.x doesn't work while Hangul Emacs works with
Hangul Input Method server if the toggle key for Hangul and English is set
to CTRL-Space instead of Shift-Space according to Choi, Jun Ho at
junker@jazz.snu.ac.kr

Stevie is a vi clone, and there is Japanese stevie named Jstevie. You can
edit hangul documents on Hanterm with Jstevie. You should compile it after
hacking a couple of lines of Makefile. Please set the code you use to EUC
codeset in the Makefile. [Contribution by Choi,Woohyung]

Stevie is now an obsolete program. You are advised to use Hangul Elvis by ,
Park, Chong-Dae, a member of SPARCS. The most recent version is helvis1.8h2+
available at SPARCS archive or its mirrors at CAIR Archive, I-NET archieve
,and Sunsite Korea. Park, Chong-Dae went at length to make helvis have as
complete Hangul support as possible and his efforts paid off well.

nvi is an enhanced vi included in BSD 4.4 and the newest version 1.79 can be
obtained at ftp://ftp.cs.berkeley.edu/ucb/4bsd. Jun-ichiro itojun Itoh
(itojun@itojun.org) did the M17N(multinationalization) of nvi and made the
m17n patch available at ftp://ftp.foretune.co.jp/pub/tools/nvi-m17n/. It's
NOT L10N(localization), but M17N or I18N. Hence, more than one
language(other than English) can be intermingled in a single document just
as in Mule. After applying m17n patch to nvi 1.79 source, compile it with
following commands in the top of nvi source tree.

  % cd build
  % ./configure --enable-multibyte=euc-kr --program-prefix=n
  % make
  % su
  % install

If you don't have the root previlege, you can just put the binary whereever
you like instead of doing the last two steps. One advantage of M17Ned nvi
over helvis is that it supports ISO-2022-KR as well as EUC-KR. On the other
hand, there's a prolonged delay when switching to the command mode from
Hangul input mode, which can be pretty annoying. According to the author,
this problem has been fixed for EUC encodings(EUC-KR,EUC-JP, and so forth)
in the newest version.

Beginning with Vim 5.3, Hangul support(as offered by Hvim mentioend below)
is included in the main tree of Vim. Vim 5.4l has even better support of
Korean incoporating patches by Nam, Sung-hyun,Park, Chong-Dae,Hwang,
Chi-deok and others. To edit Hangul documents with Vim 5.3 or later, you
need to use the option -enable-multibyte (For 5.3, add
--enable-max-feature as well. Under Unix with incomplete locale
support, --broken-locale has to be specified for 5.4l or later with
locale library support.) when configuring it before compiling and your
vimrc(~/.vimrc) file should include set fileencoding=korea.
[Contributed by Park, Chong-Dae at cdpark@jupiter.kaist.ac.kr]. For more
information on Vim, refer to http://www.vim.org/.

The following two paragraphs on CVim and Hvim are obsolete and you're much
better off grabbing the newest version of Vim and compiling it as mentioned
above.

Chinese version of vim(VI improved) can be used for Hangul editing. Chinese
patch against vim 4.2 along with vim-4.2 source is available at
ftp://ftp.csie.nctu.edu.tw/pub/Unix/Chinese/cvim/. Paek, Sung-Hoon at
shbaek@coregate.kaist.ac.kr patched vim-5.0t to support Hangul. It works
both in Unix and Hangul MS-Windows 95/NT. One can grab it atCAIR Archive (in
/hangul/incoming). Please, note that Hangul support is not as complete as
helvis, though.

Nam, Sung-hyun at <mailto:namsh@lgic.co.kr> has been active in a number of
Hangul related projects for Unix. Among them is hvim(Hangul-enabled VIM).
For details on HVIM, see http://www.sarang.net/~hvim/. (for his other
projects, refer to http://150.150.54.65/.) Recent versions works with X
input method as well.

On systems running SunOS/KLE, you can use 8-bit clean vi for hangul editing.
Set your environment variable LANG as korean. Then you can edit hangul
documents with vi or other text editors. [Contribution by Choi,Woohyung]
This is also the case of most Unix with L10N/I18N support(and Korean locale)
such as Digital Unix, AIX, HP/UX, IRIX. Unfortunately, Korean locale is
NOT usually installed by system administrators outside Korea even if it's
freely available from the vendor. You might ask your system admin. to
install Korean locale.

PICO (default editor for a popular mail program, PINE) seems to be 8bit
clean and works for Hangul. Whatever editor you use under Unix, you have to
make your 'tty' 8bit clean to enter Hangul. See Subject 16) for details on
terminal set-up. Hangul-patched pico has been made and is available for
Linux. I don't know where to get it on the Internet,though.

Joe(an editor simpler than Emacs but much more sophistcated than pico) can
be configured for Hangul editing. Invoke it with "-asis" option or add
"-asis;" to joerc file. [Contribution by Lee, Kidong at kidong@shinbiro.com]

Jun Yei at jun.yei@linmor.com released a free CJK word processor for X
window, Chinese Power 3.0. The source is freely available at
ftp://ccic.ifcss.org/pub/software/x-win/editor/ to han.comp.hangul by
Gilly(Yun G. J.) mingtian@hotmail.com]. You need to have Motif library and
header files to compile it. Under Solaris 2.5.1 and HP/UX 10.x, it was
compiled almost out of box. Linux and FreeBSD users without Motif may try to
compile it with Lesstif(free clone of Motif).

On MS-DOS machine,

Iyagi, has its own built-in editor and it's fairly nice. And VADA is a word
processor running on MS-DOS supporing the same devices as Iyagi. It was also
developed by Hanulso(now Kunsaram) [ note: almost all the softwares from
Hanulso. only support JOHAB as your document encoding. So you'll have to
make code conversions manually. Please check first if it can be configured
to handle your local code.] [Contribution by Choi,Woohyung]. Iyagi 7.3(See
Subject 2) for MS-Windows 3.1 or 95 also has Hangul editor with built-in
Hangul I/O (which means you can run it in any version of MS-Windows 3.1/95,
localized or not).

SAN is another nice Hangul editor/word processor for MS-DOS and it can deal
with both JOHAB encoding and EUC-KR (conventionally known as Wansung).It's
at major Hangul archives(three files: san1.exe,san2.exe,san3.exe).
[Contribution by Choi,Woohyung]

Hangul editor for ms windows v.3.1 is at CICA Windows archive(as
/pub/pc/win3/util/hangul.zip)(contributed by JKIM@ecs.umass.edu). There is
another (or perhaps the same) Hangul editor/word processor made by students
with SNU CS dept. available at Hana BBS archive. It consists of 4 zipped
files, winwf4-1.zip winwf4-2.zip winwf4-3.zip winwf4-4.zip. I've never used
any of these.

Lee, Jaekil at juria@seodu.co.kr released a Hangul editor (still in alpha
status) for Win32(MS-Windows 95 and MS-Windows NT) which, according to the
author, works under non-Korean version of MS-Windows as well as under Korean
MS-Windows provided that MS Internet Explorer 3.0 Hangul add-on or Global
IME is installed (See Subject 38 for Hangul add-on). You can get it at
http://www.seodu.co.kr/~juria/editor/

Meadow(Multilingual enhancement to gnu Emacs with ADvantages Over Windows)
lets you edit Hangul and many other scripts(at the same time) in any
language version of MS-Windows. For details, see
http://mechatro2.me.berkeley.edu/~takeyori/meadow/. You may also wish to
visit http://calab.kaist.ac.kr/~dtkim/java/tools/emacs.html

Duke University has developed Unicode editor for Windows NT/95/3.1, UniEdit.
With UniEdit in any language version of MS-Windows NT/95/3.1, you can edit
multilinguial text seamlessly. A try-out version is available at
http://www.lang.duke.edu.

yudit is a free Unicode editor for Unix/X11 (with motif,kde and qt widgets.
lesstif also works) developed by Gaspar Sinai at gsinai@iname.com. It
doesn't yet support Hangul input via Hangul Input method servers(such as
included in commercial Unix shipped in Korea or released on the net for
Linux), but the support is planned. Even without Hangul input method, you
can enter Hangul with Unicode code point('U' followed by 4 digit hexadecimal
number is regarded as Unicode code point). This way, one can add a few
Hangul characters not included in KS C 5601. The newest version is available
at ftp://sunsite.unc.edu/pub/Linux/apps/editors/X. Utilities accompanying
yudit include uniconv(code converter for many different encodings based on
Unicode 2.0 and ISO-2022) and uniprint which can be used for printing Hangul
and multilinguial documents with Unicoded-encoded truetype fonts like
Cyberbit,Gulim and Batang(see Subject 6)

Hangul web pages can be edited with any text editor(mentioned here) on any
platform with which you can produce plain text (HTML is plain text) in
EUC-KR(8bit encoding of KS C 5601). In case you want to use GUI-based HTML
editor, you may try HomeSite(recommened by lionson@nuri.net) or HotDog for
MS-Windows. I haven't check if they work under non-Korean MS-Windows + Hanme
Hangul/Unionway, but it's likely that they do. Netscape Gold and MS
FrontPage(only under Hangul MS-Windows) may be used, too. Namo Interactive
has released a Hangul Web editor. It's available at http://www.namo.co.kr/
or at ftp://www.namo.co.kr/pub/download/. In order to get web
pages produced by them accessible by the widest audience, users of MS Front
Page have to replace the following meta tag at the beginning of html
documents

<meta http-equiv="Content-Type"
content="text/html; charset=ks_c_5601-1987">

with

<meta http-equiv="Content-Type"
content="text/html; charset=EUC-KR">

There've been reports that some versions of MS IE don't recognize documents
with "Content-Type text/html; charset=EUC-KR" as the 8bit encoding of KS C
5601 and KS C 5636/US-ASCII as in EUC-KR. In that case, remove the meta tag
above. Another work-around used by Namo web editor mentitoned above is put
two charset parameters for Content-Type as shown below, which is not
standard-compliant, but works(Be aware that it may break things for other
browsers). Microsoft is to blame because EUC-KR has been used to refer to
8bit encoding of KS C 5601 and KS C 5636/US-ASCII in MIME Content-Type
header of Hangul mail messages(see Subject 9 and Subject 8). On top of that,
in light of RFC 2130, it's a good idea to use different names for character
set(KS C 5601 and KS C 5636/US-ASCII) and a specific encoding of character
set(EUC-KR).

<meta http-equiv="Content-Type"
content="text/html; charset=ks_c_5601-1987; charset=EUC-KR">

According to Gil,Hojin at hojing@concentric.net, Golive Cyberstudio is a WS
II savvy web editor(i.e. it works with either Korean Mac OS or KLK +
non-Korean Mac OS). mrego@nuri.net posted to a Hangul newsgroup that Visual
Page,WebObject Fusion(for MS-Windows) and Claris HomePage Hangul version(for
Mac) work well for Hangul web page editing,too. Unicorn Editor available in
http://www.concentric.net/~tsunmei/Unicorn.shtml by Xiaolin Zhao at
xlz@usa.net is known to work well under Hangul-capable environment for
Mac(See Subject 5). Unicorn Editor 1.2.2 was released in May, 1997, which is
a shareware and is available at ftp://ftp.ifcss.org/pub/software/mac/editor/.
It's designed to be used for Hangul editing/word processing without
system-wide support for Hangul(an older version used to require Hangul input
method for MacBlue Telnet,but a newever version seems to have its own input
methods and fonts for CJK) as well. As of March 1st, however, Hangul input
module for MacBlue Telnet has a couple of flaws. The author wrote to me that
he's been preparing for a new Hangul input module. Other simple text editor
like TeachText are also known to work with Hangul capbale environment
mentioned in Subject 5.

Hangul SGML editor has been developed by Natural Language processing
department at SERI(System Engineering Research Institute). [reported June,
25, 1997 by Chosun Ilbo].

 

Continue to:













TOP
previous page: 2.What kind of Hangul terminal emulators are avaiable?
  
page up: Hangul & Internet in Korea FAQ
  
next page: 4. How can I use Hangul under MS-DOS/MS-Windows and OS/2?