lotus

previous page: 8. What are KS X 1001(KS C 5601) and other Hangul codes?
  
page up: Hangul & Internet in Korea FAQ
  
next page: 10. Is there any Hangul Internet BBS?

9. How can I exchange Hangul Mails?




Description

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

9. How can I exchange Hangul Mails?

Before reading further, please take a note that what follows does not
address how you view Hangul in your environment. It's assumed that you have
no problem viewing and entering Hangul text in your environment although
you have some difficulty deciphering some cryptic jargons (e.g. encoding,
MIME, base64, charset, etc) required for standard-compliant exchange of
Hangul messages. As for reading and writing Hangul in your platform, you
need to refer to other parts of the FAQ. Of particular relevance to them are
Subject 2(Hangul terminal emulators), Subject 3(Hangul editors), Subject
4(MS-DOS/Windows Hangul environment), Subject 5(Mac Hangul environment) and
Subject 6(Unix Hangul environment). You may also wish to read Subject 36, 37
,and 38 on viewing Hangul web pages.

Internet mail exchange protocol, SMTP(Simple Mail Transfer Protocol) as
specified in STD 10 (RFC 821) is not '8bit clean' and a number of installed
implementations of SMTP - Mail Transport Agents(MTA) like sendmail,
smail,and mmdf - did not transparently pass 8bit characters such as used in
EUC-KR(8bit encoding of Hangul standard coded character sets,KS X 1001(KS C
5601) and KS X 1003(KS C 5636)/US-ASCII) and ISO-8859-x(European char.)
although increasing number of MTAs become 8bit transparent and some of
them(e.g. sendmail 8.7 and later) faithfully implement ESMTP ( RFC 1869 and
RFC 1652). Hence, need for some form of encoding conversion/transfer
encoding(to use only lower 7bits) existed in the past and still exist in
some cases. Listed below are a few transfer encoding/encoding conversion
methods widely used.

Please, note that a new Korean mail exchange standard(which has been already
in wide use for a couple of years) will be announced sooner or later. One of
the most notable changes will be ISO-2022-KR/7bit won't be used any more in
outbound messages. Over a 8bit transparent transport channel, EUC-KR/8bit
will be used exclusively and EUC-KR/Base64 (or EUC-KR/QP) over a 7bit
transport channel. When the official announcement is made, I'll revise this
part of the FAQ to reflect the new standard.

EUC-KR/8bit
8bit encoding - compliant to EUC(Extended Unix Code) spec. by AT&T - of
Korean standard coded character set for Hangul,Hanja,and special
characters KS X 1001(KS C 5601)(which will be phased out and superceded
by KS X 1005-1(KS C 5700) See Subject 8) and US-ASCII/KS X 1003(KS C
5636: Korean equivalent of US-ASCII with backslash replaced by Korean
currency sign). As mentioned above, many MTAs nowadays are 8bit
transparent so that they have little trouble transmitting messaage in
8bit encodings(MIME charsets) like EUC-KR. EUC-KR will be the default
encoding to use in Korean mail exchange and 8bit will be the
content-transfer-encoding for 8bit transparent path. For 7bit only
path(more exactly all the paths not confirmed to be 8bit clean), either
Base64 or Quoted-Printable should be used in accordance with RFC 1652.
ISO-2022-KR/7bit
used to be standard for Hangul mail exchange specified in RFC 1557. Still
a number of mails from Korea and sent using Netscape 4.x are in
ISO-2022-KR(header is B encoded with charset name EUC-KR following RFC
2047). See below for detail. Programs supporting ISO-2022-KR are

o OLD Hangul Sendmail : MTA-level implementation of RFC 1557 by one of
authors of RFC 1557, Choi,Woohyung. Automatically converts EUC-KR to
and from ISO-2022-KR with B encoded header. Hangul sendmail 8.6.x has
several bugs as well as serious security holes associated with
sendmail 8.6. You should install NEW Hangul sendmail 8.8.8H2 by
Roh, Jungsuck(sp?) or another NEW Hangul sendmail (8.8.8Ha) by Suh,
Sang yong, instead. New Hangul Sendmail converts incoming 7bit
iso-2022-kr back to 8bit euc-kr, but doesn't convert outgoing euc-kr
to iso-2022-kr. The former is available at
http://cair.kaist.ac.kr/~chester/sendmail.html and the latter at
ftp://ftp.kigam.re.kr. To install either of them, you need to have the
root previlege on a Unix host. However, I strongly recommend you not
use Hangul sendmail, old or new as it violates several Internet mail
standard(RFC 1652, RFC 2047). To be interoperable with MA(Mail Agent)s
still following old standard(RFC 1557), you are infinitely much better
off using procmail(with appropriate recipe) as the MDA (Mail Delivery
Agent) for MTA(sendmail and others) given below and at
http://pantheon.yale.edu/~jshin/faq/procmail.html.
o Cubic Mail for Java : Choi, Hee-chang at hcchoi@idigm.co.kr released a
truly excellent Hangul mail client(POP3/IMAP4 client) in pure Java. It
can be run on any platform where Java application can be run as it's
written in pure Java. With bulit-in Hangul input/output, it enables
you to read and write Hangul mail in any language version of any OS as
long as you can run Java application. You can get it at
http://www.idigm.co.kr/cubic/ Please, note that it's not a freeware
but a shareware, but I think it's a lot more than worth shareware fee.
o Procmail with appropriate procmailrc (automatic decoding only) which
can be installed by either ordinary users or by system admin. as a
Mail Delivery Agent(MDA= local mailer) along with the original
sendmail 8.8. See below and
http://pantheon.yale.edu/~jshin/faq/procmail.html for detail. It can
be used whatever program(netscape,eudora,pine,elm,etc) you use to read
your mail on whatever platform(Unix,Mac,MS-Windows).
o KESMPRE( Sendmail Preprocessor for Hangul Mail Exchange): Sitting in
place of sendmail 8.8, it converts outgoing Hangul messages in EUC-KR
into ISO-2022-KR before handing them over to real sendmail. Made by
Park, Jae-hyon in Physics Dept. of KAIST. When installed by the system
administrator along with procmail+code converter to deal with incoming
mail in ISO-2022-KR, it would make unnecessary patching every Mail
User Agents(MUA) and POP3/IMAP4 clients users wish to use for Hangul
mail handling. Further information is available at
http://entropy.kaist.ac.kr/~jhpark/kesmpre/.
o Hangul Mail 1.0.2 : Control panel for automatic encoding conversion in
Hangul mail exchange on Mac by Jeong-hyun Kim at
jhkim@salmosa.kaist.ac.kr : available at Mac Hangul Archive1 (
/pub/mac/internet-sw),CAIR archive and its mirrors and UCSD archive.
o MS Internet Mail and MS Exchange : support ISO-2022-KR with some
problems depending on what version you use.(See below). Note, however,
that Korean MS Internet Mail only works with Korean(and Chinese and
Japanese) version of MS Windows 95/NT. MS Internet Mail for Hangul MS
Windows 3.1 was also released in December,1996.
o Netscape 4.03 or later(early betas such as 4.0b2 have some problems,
but those bugs have been fixed in the final release) supports
automatic detection and conversion of messages in ISO-2022-KR to
EUC-KR . For outgoing messages, it always uses ISO-2022-KR in message
body regardless of MIME/QP is turned on or off in mail setting. Next
release of Netscape will use EUC-KR in place of ISO-2022-KR to be
compliant new Korean mail exchange standard.
o MS Outlook Express and Outlook97: inbound messages in ISO-2022-KR is
properly displayed(with some patches for old version. See below) and
outbound messages are sent out EUC-KR/8bit. Korean versions of these
two programs might not work under non-East-Asian version of MS-Windows
95/NT. However, there's a report that it works in English and French
version of MS-Windows NT/95 as long as displaying the body of the
message is concerned. It still used to require external programs for
Hangul input. With the release of Korean IME(Input Method Editor),
this is not the case any more. You can compose Korean messages in any
language version of MS Windows 95/NT by installing Korean IME
available at MS IE web page at http://www.microsoft.com/ie/. Korean
version also offers Unicode(UTF-7 and UTF-8) encoding,but one needs to
be very careful NOT to choose either of these in Format(O)-Language(G)
of the message composition window as most people can't handle UTF-7 or
UTF-8, yet.
o HanMail 96 : MUA for MS-Windows that comes bundled with HWP Pro 96 by
Hangul & Computer. The first release is very buggy.
o Hangul-patched mail programs(MUA) for Unix : mutt and elm(old one. may
not be available any more).
o encoding converters : hcode, hmconv for Unix and MS-DOS and Hangul
Mail Converters for Mac.
o decoder : hdcod for Unix, cvt8.exe for MS-Windows and
Netscape-mail-folder decoder for MS-Windows.
o Pine 3.94/3.95/3.96K + encoding converter : See below and refer to
pine.html at http://pantheon.yale.edu/~jshin/faq/pine.html for
details.
o Mule and GNU Emacs 20/XEmacs 20 : multilinguial extension of emacs(of
which features have been incorporated into Emacs 20), supports both
ISO-2022-KR and EUC-KR, so that mule(and emacs mail packages like
Rmail,VM, and MH-E) users should have little problem with reading
ISO-2022-KR-encoded Hangul mail. However, care should be taken not to
encode Hangul apperaing in mail header in ISO-2022-KR. A recipe to
avoid this problem is mentioned below.
o KUMailer(Free POP3 client for MS-Windows 95) : Cho Soohyun at
shcho@widecomm.korea.ac.kr released a flexible(in terms of user
control over which transfer encoding and/or MIME charset to use) POP3
client. It's available at http://widecomm.korea.ac.kr/~shcho/mua.html.
o AsianView for MS-Windows 3.1/95,Unionway for MS-Windows 3.1/95/NT,and
NJWin for 3.1/95/NT (See Subject 4) automatically detect and display
ISO-2022-KR. The original NJWin 1.20 has some problem with converting.
You need to get and install bug-fixed DLL files( njdbcs.dll and
njtext16.dll) available at ftp://yes.snu.ac.kr/. Bug-fixed DLL
file for AsianView is also available at the same place. [Contribution
by Yi, Yeong Deug at queen@yes.snu.ac.kr]. You need to get the newest
build of Unionway(the one available via download has a bug and doesn't
decode ISO-2022-KR) by following the link to membership at
http://www.unionway.com.
o ISO-2022-KR to EUC-KR conversion page at
http://cosmos.changwon.ac.kr/cwnu/e_mail.html

In addition,most Unix mail programs(e.g. Pine 3.92 or later,
elm,mail,mailx,and Rmail and mh-e for emacs) along with encoding
converters can be configured to convert Hangul as necessary for Hangul
mail exchange automatically or semi-automatically as described below. By
converting your outgoing Hangul mail to ISO-2022-KR, you will make life
of your correspondents who use HiTel and Nownuri in Korea easier. In case
Hangul MTA(Hangul sendmail) is installed on one's SMTP(mail) server(which
is often the case in Korea), one has to turn OFF 'enable QP' in Eudora(it
has a serious problem with Hangul mail, though) and choose 'Allow 8bit'
in Netscape-Mail(up to 3.0) to make outgoing mail properly encoded in
ISO-2022-KR.
EUC-KR/Base64
more economical than QP for Hangul mail exchange. Supported by Pine,
Elm(read-only in most versions with metamail. Some recent variants of Elm
seem to support MIME attachment as well) and any MIME-aware MUAs under
Unix and several MUA/POP/IMAP clients for Mac/MS-Windows such as Netscape
mail. mmencode included in metamail package can be used for manual code
conversion to/from Base64 and QP in Unix. In MS-Windows, wincode can be
used the same way.
uuencode
Unix community and nowadays with explosive growth of the Net, Mac and
MS-DOS/Windows as well, have used a pair of encoder/decoder,
uuencode/uudecode to exchange binary data(requiring all 8bits) via e-mail
and Usenet News. uuencode, however, will be phased out and replaced by
Base64(one of MIME standard encoding). Chollian MagiCall users seem to
have choice of sending their outgoing mail either in ISO-2022-KR or
encoding in uuencode.You had beeter avoid using uuencode for any purpose
including Hangul mail and binary file exchange because uuencode has
several different implementations(thus incompatible with each other) and
uuencoded messages get broken when passed over to hosts with charset
different from US-ASCII(e.g. EBCDIC),which led to a new encoding scheme,
Base64.
EUC-KR/QP(Quoted Printable)
the most suitable for ISO-8859-1(West European character sets with small
fraction of 8bit characters), but can be used for Hangul mail(in EUC-KR)
exchange as well. Supported by Pine,Elm (with metamail installed) and any
MIME-aware MUAs(Mail User Agent) under Unix and a number of MUA/POP/IMAP
clients including Netscape mail,Agent and Eudora on
Mac/MS-Windows.Currently, for POP3 client users(on Mac/MS-Windows)
outside Korea on whose mail/pop3 server Hangul sendmail cannot be
installed, this, along with Base64, is the most convenient and certain
option to send out Hangul mail although recipents in Korea without
MIME-compatible MUAs may have difficulty decoding QP-encoded messages. To
encode your outgoing messages in QP/Base64, turn on 'May use QP' in
Eudora,check 'MIME'(instead of 'Allow 8bit') in Netscape 3.0
(Options|Mail&News|Composition menu) in MS Outlook express (see below for
details on configuring MS Outlook Express) Please, note that Netscape
4.0, unlike Netscape 3.0, sends outgoing messages in ISO-2022-KR
regardless of whether MIME is selected or not if Encoding is set to
Korean.

In case you think this document is too difficult to understand and you never
use Unix to read and send mail, you may refer to Yi,Yeong Deug's Hangul Mail
FAQ available at http://yes.snu.ac.kr/queen/hmailfaq.htm. Kang, Kyung-soo at
kangksoo@chollian.net posted a series of articles to Usenet newsgroup
han.answers,han.comp.mail and han.comp.hangul explaining how to configure MS
outlook Express and Netscape for Hangul mail exchanges in very
easy-to-understand manner.(It's a must for those using Internet under
MS-Windows) You can view his articles on Dejanews Power search with the
search term "~g han.answers and ~a Kyung-soo" or you may try Hitel Q&A
section at http://www1.hitel.net/dong/o/osc.html. Lee, June Young at
leejy@hyowon.cc.pusan.ac.kr also has put up on the web an excellent
information on Hangul mail exchange with MS Outtlook Exprees. His page is
found at http://skyhawk.i.ml.org/oesetup/oesetup-image.html. When using MS
OE, you need to make sure that the language is set to Korean(rather than
Unicode) in Format(O) - Language(G) menu of the message composition Window.
Another very good site about Hangul mail with extensive information on
sendmail and Hangul code has been put on the web by Lee, Sanglo at
http://trade.chonbuk.ac.kr/~leesl/mail/.

Hangul mail has been widely spread since 1992 when Choi, Woohyung suggested
a ISO-2022 conformant encoding method, and made a pilot implementation for
ELM(still available at major Hangul archive). Later, he modified
sendmail(the most widely used MTA-Mail Transfer Agent- under Unix) for
automatic encoding conversion between EUC-KR and ISO-1022-KR in message body
and B(base64) encoding in message header. As mentioned above, however,
sendmail 8.6.12h2(old Hangul sendmail) has several bugs and security
holes(found in the original sendmail 8.6) and all the sites with this
version of sendmail must upgrade to sendmail 8.8/8.9(the newest is 8.9.0 as
of June, 1998)+ procmail or sendmail 8.8.8h1/ sendmail 8.8.8Ha (new Hangul
sendmail).

With Hangul Sendmail(old and new) or sendmil+procmail (procmail solution can
be used together with MTA other than smail,qmail and mmdf as well)
installed, any user level mail program(MUA:Mail User Agent ; e.g.
pine,elm,mh,xmh,mailx,mail) can be used to transparently exchange Hangul
mail. Users of POP3 clients for MS-Windows and Mac(MS Outlook Express,
Netscape mail,Claris Emailer.etc) are relieved of inconvenience of encoding
conversion with Hangul Sendmail on their POP3 server and SMTP(mail) server.
(In this case, 'Quoted Printable' should be turned off - equivalently 'Allow
8bit' is to be turned on- in POP3 client. Charset should be set to EUC-KR
or Korean whenever possible. This is crucial especially in Mac version of
Netscape and Forte Agent for MS-Windows. In Netscape for Mac, setting
charset to one other than Korean results in completely gobbled-message. See
Subject 24 for Forte Agent). Eudora as is released by Qualcomm has a serious
problem with Hangul mail exchange does NOT offer any means to set charset to
EUC-KR. There's a perfect work-around for Mac version of Eudora. MS-Windows
version of Eudora doesn't even have a room for such work-around although Yi
Yeong Deug came up with a work-around that works for text/plain type
messaeg(i.e. message without attachment). The same is true of Hangul Mail
1.0.2 for Mac with code-conversion for outgoing message turned on.

Technical details on Hangul mail exchange is described in
RFC-1557(ftp.internic.net/rfc) submitted to IETF by Choi, Woohyung and Prof.
Chon, Kilnam(chon@cosmos.kaist.ac.kr) with CS dept. at KAIST and Park, HJ
(hjpark@dino.media.co.kr) at Solvit Chosun Media. Information on old Hangul
Sendmail are found at http://cosmos.kaist.ac.kr. Documents mentioned there
include Hangul mail guide in /pub/hangul/mail at CAIR archive and mirrors
and Hangul Sendmail.FAQ by Choi, Woohyung at
http://cosmos.kaist.ac.kr/pub/whchoi/dist/untarred/FAQ.Hangul. Please, be
aware that these documents got very much out-of-date with recent
developments in Hangul mail exchange standard (on which virtually every
party involved agreed that ISO-2022-KR/7bit not be used any more and EUC-KR
be the default encoding for Hangul mail exchange)

Unfortunately, Hangul Sendmail and Procmail as MDA are to be installed by
root (system administrator), so that most people outside Korea (except for
those with root previlege to install Hangul Sendmail) have to figure out how
to do what Hangul Sendmail does, encoding conversion: convert a message in
whatever Hangul code you use locally into ISO-2022-KR before sending out(the
new Hangul sendmail doesn't do this any more. Neither does the original
sendmail(+procmail), needless to say) and convert incoming mail (from Korea)
in ISO-2022-KR to your local code(usually EUC-KR).

In HCODE distribution, you may find a document for Hangul mailing with hcode
v.2.1. It's for Berkeley mail ,but you should be able to do the same for
other mail programs once you understand what it does for Berkeley mail.
hcode 2.1 has a few glitches in code conversion for mail exchange (
-ki,-ik,-dk,-kd options. e.g. See Subject 8) The newest patched version,
hcode2.1-mailpatch2 available in /pub/hangul/code/hcode of CAIR archive
solves all of these incompatibilities, so that you have to get this one to
avoid complaints from your correspondents in Korea. MS-DOS binary of hcode
2.1-mailpatch2 (hcode21m.exe compiled with old Turbo C 3.0) can be obtained
in /hangul/code/hcode of CAIR archive.

I wrote a simple code/encoding converter between EUC-KR and ISO-2022-KR,
hmconv available in /hangul/code/hmconv of CAIR archive. The newest one
(which now works with Pine 3.93 or later in Solaris 2.x where it used to
have a problem) is packaged together with Hangul patch for Pine 3.96 in
pine396k2.patch.tar.gz which also contain detailed instruction on how to use
it to completely automate Hangul mail exchange and is now available in
separate package hmconv1.0pl3.tar.gz at CAIR archive. MS-DOS binary of
hmconv compiled by Yi, Yeogn Deug is available at his archive
ftp://yes.snu.ac.kr/. MS-DOS binary can be used for manual encoding
conversion for Hangul messages. MS-DOS and MS-Windows(no GUI) binary of
hmconv with a brief document are available in a package hmconv.zip in
/hangul/incoming of CAIR archive

ELM users should read README.elm(at
http://pantheon.yale.edu/~jshin/faq/README.elm) for configuration to
automate Hangul mail exchange with hmconv and ELM. I found Pine 3.93 or
later with displayfilter and sendingfilter very convenient for Hangul mail
without Hangul sendmail and strongly recommend it, whose source and binaries
for virtually all flavors of Unix' are available at
ftp://ftp.cac.washington.edu/pine. As binaries are available, you don't need
to compile it(you have to compile it if you wish to apply Hangul patch. See
below) and you can install it in your home directory without root permission
in most flavors of Unix.

I patched Pine 3.95(the newest as of Aug. 12,1996) to remove a couple of
incompatibilities with RFC 1557 and Hangul MTA. The newest patch against
Pine 3.96(pine396k2.patch) is available at
http://pantheon.yale.edu/~jshin/faq/pine396k2.patch. pine 395k.patch.tar.gz
(available in /hangul/mail/Others of CAIR archive) contains an improved
version of encoding converter, hmconv 1.0pl3 and detailed instructions to
compile Pine 3.95k and to configure it for Hangul mail exchange. I tried it
in Linux 2.0,Solaris 2.5, and Sun OS 4.1.x and it worked fine. Linux binary
for Hangul patched Pine 3.96(the newest) is available at
ftp://romance.kaist.ac.kr/pub/linux/. Instructions for Pine
configuration is also available here as pine.html (at
http://pantheon.yale.edu/~jshin/faq/pine.html. Pine395k.patch can be applied
without any problem to Pine 3.96 announced by Univ. of Washington in March,
1997. Pine source ported to FreeBSD is available at
ftp://ftp.freebsd.org//pub/FreeBSD/ports-current/. According to Jonghwan
Park at morph@soback1.kornet.ne.kr, Pine 3.95 Hangul patch works fine with
FreeBSD port as well.

Some of you who want to post-process mail folders using tools like
sed,awk,perl, and grep find it inconvenient to handle mail folders in
ISO-2022-KR. I came up with an efficient way to convert mail folders in
ISO-2022-KR(+ B encoded header) to EUC-KR. It requires procmail and its
accompanying utilities(formail) along with hmconv and hcode. Detailed
instruction is found http://pantheon.yale.edu/~jshin/faq/procmail.html. In
case procmail and formail are not available, you may use a simple(but much
slower) perl script I made and hcode to convert mail folders in ISO-2022-KR
to EUC-KR. It converts not only message body but header information as well.
The script is available at http://pantheon.yale.edu/~jshin/faq/mboxconv.pl.
hmconv can be also used to convert mail folder in ISO-2022-KR(with multiple
Hangul messages in ISO-2022-KR) back to EUC-KR. Please, note that hmconv
doesn't change header information and accordingly mail folders converted
using it have header information inconsitent with encoding and/or charset
used in message body.

Similar automation is possible even with the simplest mail user agent, mail
or mailx available in most, if not all, varionts of Unixen. Following recipe
is given by Kim, Daeshik at dkim@cwc.com. Add following lines to .mailrc in
your home directory

set crt=1
set VISUAL=hmailedit
set PAGER=mpager

where hmailedit is a shell script listed below and mpager is another script
with following lines.

#!/bin/sh
hmconv -u | less

hdcod 0.3, a decoder for ISO-2022-KR,QP and Base64 with automatic detection
of encoding type, by Park, Myeong-seok at pms@romance.kaist.ac.kr can be
used similary. hdcod 0.3 is available at
ftp://romance.kaist.ac.kr/pub/linux/han/hdcod. Automatic detection of
encoding type is pretty handy in case you don't have MIME-aware mail program
and don't want to be bothered with figuring out which encoding is used in
mail you received although it's not hard at all. In Mule 2.3, including the
following line in ~/.emacs would make your outgoing mesage in EUC-KR.

(define-program-coding-system nil ".*mail.*" *euc-kr*)

In Mule 19.33, ISO-2022-KR is automatically detected and displayed
accodingly. You have to add, however, this line to avoid your outgoing mail
encoded in 7bit ISO-2022,default coding system in Mule.
coding-system-euc-korea needs to be replaced with euc-kr in
Mule 19.34.31 and Emacs 20.x(See Subject 3)

;; This line is NOT necessary in Emacs 20.x if you
;; include (set-language-environment 'korean) in your ~/.emacs file
;; (See Subjet 3)
(setq sendmail-coding-system 'coding-system-euc-korea)

;; Three lines below are optional MIME header
;; You don't need this if you use one of MIME tools for
;; Emacs/Mule(e.g Semi/TM)
(setq mail-default-headers "MIME-Version: 1.0
Content-Type: text/plain; charset=EUC-KR
Content-Transfer-Encoding: 8bit\n")

If you want to send outgoing message in 7bit ISO-2022-KR, you may add
following lines, instead.(This is NOT recommended any more) Be aware that
Mule puts Hangul in header as well as in body into ISO-2022-KR, which is a
violation of RFC 1557 and makes your message unreadable by non-Mule users.
Hence, you should not enter Hangul in header if you include lines below. One
workaround is encode(in RFC 2047-style) message header with Hangul with
'hcode -kd' and 'shell-command-on-region' before sending
it out. Un, Koaunghi figured out how to automate this. See below.

(setq sendmail-coding-system 'coding-system-iso-2022-kr)
;; In Emacs 20, use the following lines with the leading semi-colones
;; removed, instead
;; (setq sendmail-coding-system 'iso-2022-kr)
;; (add-hook 'mail-mode-hook
;; (function (lambda ()
;;              (setq buffer-file-coding-system sendmail-coding-system))))
  
;; This is OPTIONAL to make your message compliant to
;; RFC 1557
(setq mail-default-headers "MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-KR
Content-Transfer-Encoding: 7bit\n")
  
. 

Similar setting should be possible for mh-e and other mailers for Mule.

The author of HLaTeX, Un, Koaunghi came up with a much better way to make
outgoing Hangul mail compliant to RFC 1557(now NOT necessary any more as
EUC-KR is so widely used). It uses a modifield send-mail-function along with
a couple of shell scripts,hmconv, and hcode2.1-mailpatch2. For details,
refer to his posting to Hangul Usenet newsgroup han.comp.mail I made
available at http://pantheon.yale.edu/~jshin/faq/emacs-mail.doc. You don't
have to change rmail-movemail-program in case you install procmail to
convert incoming hangul message back to EUC-KR.

Some MUAs(Mail User Agent:user mail reading program) allow users to select
PAGER to display message in mailbox. For instance, in elm, you may set, in
'option' menu or by editing .elm/elmrc in your home directory, 'pager' to

hmconv -u | more

or

hmconv -u | less

. In pine 3.91 and elm, you may press "|" (Pipe to a Unix command) while
viewing incoming Hangul message encoded in ISO-2022-KR(thus illegible) and
give following command to display it in EUC-KR.

hmconv -u

. pine 3.93 has an option for 'displayfilter' which is very useful for
viewing Hangul messages in ISO-2022-KR. Set 'displayfilter' to ""
hmconv -u.

In case elm on your system supports MIME and metamail at
ftp://thumper.bellcore.com/pub/nsb is installed on your system, you may want
to add following lines, instead of changing pager shown above, to .mailcap
in your home directory. 'hmconv -u %s | more' can be replaced by 'mpager %s'
if you put 'mpager'(shell script listed above) in your search path(e.g.
~/bin). 'less' can replace 'more', here. For environment variable setting to
display Hangul text with 'less', see Subject 16

text/plain; hmconv -u %s | more ; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-2022-kr
text/plain; hmconv -u %s | more ; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = euc-kr
text/plain; hmconv -u %s | more ; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1

A much(infinitely) better way is write mail filter to convert back to EUC-KR
and redirect to separate mail folder in your home directory incoming Hangul
mail in ISO-2022-KR. A easy way to tell if message is in ISO-2022-KR is
match the designator sequence of ISO-2022-KR( ESC$)C where ESC stands for
ASCII 27) at the beginning of any line. I guess a popular mail filter,
procmail has pretty robust file-locking scheme to reduce,if not eliminate,
the danger of losing incoming mail. (Refer to
http://pantheon.yale.edu/~jshin/faq/procmail.html for step-by-step
instruction to install procmail to convert incoming Hangul message
automatically. Please, note that this is the most handy for those who use
POP3 clients like Netscape-Mail,Eudora,non-Hangul version of MS-Internet
Mail which cannot handle ISO-2022-KR and who can still access their mail box
via Unix shell account). For instance, you can put into .forward in your
home directory(Be aware that the example below doesn't work on all hosts and
that the exact content of .forward depends on mail related configuration
of your system. On hosts where procmail is a local mailer/MDA (mail delivery
agent), .foward is not necessary at all. Read procmail.html
aforementioned for more details)

"|IFS=' ' && exec /full/path/procmail -f- || exit 75 #your-login-name"

and in .procmailrc(note that this is the simplest recipe. For a much better
recipe, refer to procmail.html mentioned above)

LOGFILE=/your/home/directory/.procmaillog
VERBOSE=no
PATH=/usr/local/bin:/usr/bin:/bin:/your/home/directory/bin
:0 fw
|hcode -dk -m

With this set-up properly, you don't have to worry about encoding
conversion, as far as incoming Hangul message is concerned. In case MMDF is
used instead of sendmail or smail as MTA on your host, you need
~/.maildeliver with following instead of ~/.forward.

default - | A "/full/path/hcode -dk >> /full/path/system/mailbox"

With procmail(which is much better), .maildelivery can be

default - | A "/full/path/procmail -f-"

Not having used MMDF, I'm not sure this really works. It might or might not
work. It would be great if anyone using MMDF (The default MTA of SCO Unix is
MMDF) try what I wrote above and give me some feedback(success or failure
story and fix if necessary).

If your site uses smail as the MTA instead of sendmail, you can still use
procmail by invoking it from .forward or ~/.procmailrc if it's designated as
the local mailer. You system admin should be able to answer this. You may
wish to ask her/him to install procmail as the local mailer. Park, Chu-yeon
at kokids@doit.ajou.ac.kr posted the following procedure to Usenet newsgroup
han.comp.mail

1. Edit transports file (/etc/smail/transports in Debian Linux) as
following

   # Using procmail as local mailer(MDA)
   local:  driver=pipe,
           from,
           local,
           inet,
           return_path,
           unix_from_hack;
           user=root,
           cmd="/full/path/procmail -d $($user$)"

2. Edit the global procmailrc as outlined in
http://pantheon.yale.edu/~jshin/faq/procmail.html.
3. Restart smail

qmail is another MTA which has gained a lot of popularity recently. If your
site uses qmail as MTA and procmail is not a local mailer(ask your system
admin about this), you can put the following line to .qmail in your home
directory to use procmail to filter incoming mail.

   | preline /full/path/procmail

Please, note that you need to compile procmail 3.11pre7 with MAILSPOOLHOME
in src/authenticate.c set to .mail. (It's relative to each user's home
directory). The problem was dealt with in a thread in qmail and procmail
mailing list. You may read all the articles in the thread at
http://www.ornl.gov/cts/archives/mailing-lists/qmail/1997/11/msg00385.html.

Alternatively, superuser(system admin.) can configure procmail as the system
wide local mailer by invoking qmail with the following command

qmail-start '|preline /full/path/procmail' splogger qmail &

insetead of

qmail-start ./Mailbox splogger qmail &

Still another alternative is get procmail 3.11pre7 patched to work better
with the mail delivery model of qmail. It's available at
http://www.qcc.sk.ca/~bguenter/distrib/procmail-maildir/.

Besides, Hanterm can display Hangul messages in ISO-2022-KR strictly
following RFC 1557 and 'metamail' may be made use of for some (usually from
ill-configured Hangul mail program)Hangul message by setting mailcap and
mime.types appropriately.

Park,Myeok-Seok at pms@romance.kaist.ac.kr patched a version of
mutt(elm-like MUA with built-in MIME handling) for Hangul mail exchange
conformant to RFC 1557 either with or WITHOUT Hangul MTA(Hangul sendmail).
Those without root previliege on their hosts to install Hangul MTA may get
it to be relieved of hassle of code conversion in Hangul mail exchange. Note
that it may still need permission of system admin. to install 'mutt'
depending on flavor of Unix. Hangul mutt is available at
ftp://romance.kaist.ac.kr/pub/linux/ and in /pub/hangul/Others at CAIR
archive. Mutt is an excellent mail program and can be used for Hangul mail
exchange even without Hangul patch if you have your incoming mail
automatically filtered by procmail as mentioned above. Those who are
reluctant to switch to Pine from Elm may find it a very good replacement for
Elm with a lot of goodies not available in Elm(far superior MIME support,
PGP support, mouse support in xterm, etc). For more information, see Mutt
home page at http://www.cs.hmc.edu/~me/mutt/. When configuring mutt, you
have to give '--enable-locales-fix' option. The globabl configuration
file(Muttrc) or personal configuration file(~/.muttrc) should contain the
following lines[posted by Park, Chong-Dae at cdpark@jupiter.kaist.ac.kr.

set allow_8bit
set use_8bitmime
set charset="EUC-KR"
set ascii_chars

For those who use POP client like Eudora and Netscape mail(up to 3.01) under
MS-DOS/Windows or Mac OS, the most convenient way to handle incoming
ISO-2022-KR encoded message, set up a mail filter like procmail on a Unix
host where incoming mail is saved to convert automatically ISO-2022-KR back
to EUC-KR. See procmail.html(at
http://pantheon.yale.edu/~jshin/faq/procmail.html for how to install
procmail. In case one may not access Unix host with incoming mail box,
Hangul code converters like iso2ks/ks2iso and hcode 2.10 available at CAIR
and major Hangul archives have been ported to MS-DOS. Besides, Lee, Jun Hee
at jhlee@ain.icube.co.kr made a decoder/converter for MS-Windows 95/3.1,
cvt8pac.exe in /hangul/incoming (along with cvt8.doc available in
/pub/hangul/code) at CAIR archive, which supports converting/decoding
ISO-2022-KR,QP(Quoted Printable), and uuencode. Cha,Jae Choon at
jccha@math.kaist.ac.kr made a mail-folder converter(ISO-2022-KR to EUC-KR)
for Netscape Inbox which is availbable at
ftp://knot.kaist.ac.kr/pub/Netscape-hmail-conv. Still another and more
convenient way is install either NJWin, Unionway or Asianview capable of
automatically detecting and displaying ISO-2022-KR. See Subject 38 for more
details on these programs.

For Mac users, Kim,Jeong-hyun (jhkim@salmosa.kaist.ac.kr) made a
control-panel called 'Hangul Mail' 1.0.2 which automatically converts
incoming Hangul mail encoded in ISO-2022-KR back to EUC-KR on its way to a
local Mac(on which POP clients like Netscape and Eudora run) from POP3
server where your mail box is. Moreover, it converts outgoing message in
EUC-KR into ISO-2022-KR on its way to SMTP(mail) server. It superceded 0.5b2
which worked only for receiving(ISO-2022-KR to EUC-KR convertion) mail.
It's, however, still a beta so that you're encouraged to try it and report
bugs to the author. Besides, it's found by Park, Seungwoo that it doesn't
work with Netscape and Claris Emailer on Power Mac running OpenTransport
intead of MacTCP although it works with Eudora Light 3.x on both Power Mac
and Netscape,Claris Emailer, and Eudora on 680x0-based Mac. Kim, Jeong-hyun
has been looking into it, but the problem is non-trivial and it may take him
very long to come up with fix. (In the meantime, those PowreMac and Netscape
usres need to switch to Eudora Light 3.x available free at
http://www.eudora.com or use Procmail-based solution described above.
Another alternative is do manual code conversion with Hangul Mail Converter
mentioned below). With this nice tool, you're completely relieved of manual
code conversion. Eudora and Claris Emailer users have to get
Resource-patched versions for proper handling of outgoing Hangul mail with
Hangul Mail 1.0.2. Hangul-patched Eudora Light and Hangul patch for Eudora
Light and Pro and Claris Emailer are avaliable /pub/mac/internet-sw at Mac
Hangul Archive 1 and UnderB archive. It can be used not only with KLK
+English Mac OS and Hangul Talk but also with Hangul Korean Kit(Hantorie)
and English Mac OS with display font set to TerminalHan-KS. Netscape users
should make sure Document Encoding in Options menu is set to Korean to avoid
MacLatin -> ISO-8859-1 charset conversion which leads to completely gobbled
messages. You may still want to get Hangul Mail Converter for ISO
2022-KR(ks2iso/iso2ks), Hangul-Mail-Converters.hqx by the author. Both of
them are available in /pub/mac/internet-sw at Mac Hangul Archive 1.
'Hangul_Mail_Converter.hqx' contains a nice document to help you better
understand Hangul mail exchange. See also a nice web page by Jeong-hyun Kim
at http://scorpion.kaist.ac.kr/my_HTML/email.html#hmail

According to Daniel NK Lee of Microsoft at nklee@microsoft.com, Hangul
Exchange under Hangul Windows 95(+Hangul Plus!) implements RFC 1557 at MUA
level so that it can be used for Hangul mail exchange following RFC 1557
without localized MTA like 'Hangul sendmail'. Note, however, that Hangul
MS-Exchnage has some glitches in implementation of RFC1557 and a little
incompatibility with other implementation of RFC 1557(Hangul sendmail and
code converters like hmconv,hcode). These bugs are known to be being worked
on by Microsoft. Microsoft Internet Mail (Hangul version) also has a bug
with ISO-2022-KR although it works better than Hangul Exchange. In MS
Internet Mail, MIME encoding type should be set to 'NONE' and language(or
character set) to Korean. It should be noted that Korean MS Internet Mail
does NOT work with non-Korean version of MS Windows 95/NT even with Hanme
Hangul or Unionway.(although it sort of work with Japanese version of MS
Windows NT/95) as posted to han.comp.hangul by Yi, Young-deug, Soh, Jaeshin
and Lee, Jae-ho.

As noted earlier, many users outside Korea have trouble reading messages in
ISO-2022-KR while they can read messages in 8bit EUC-KR or Base64/QP encoded
EUC-KR, unfortunately MS-Internet Mail doesn't allow this by default. (On
the other hand, MS Outlook Express and Outlook 97 send Hangul message in
EUC-KR/8bit by default. You'd better upgrade as soon as possible.) Yi,Yeong
Deung, however, came up with a clever work-around to send messages in
EUC-KR(or Base64 encoded EUC-KR) which can be read by those without means to
automatically convert ISO-2022-KR encoded message back to EUC-KR. Using your
favorite plain-text editor, make following file and save it as 'EUC-KR.reg'
and put the icon for the file in a convenient location(StartUp menu or
desktop).

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Mail and News\Mail]
"Default Charset"="EUC-KR"

If you wanna send Base64 encoded EUC-KR message, double click the icon
before launching MS Internet Mail, choose MIME and Base64 as the encoding
method.

Like MS-Internet News, Korean MS-Internet Mail is overly sensitive to
charset information in mail header, by which it determines which font to use
to display messages. A lot of Hangul messages (especially those sent by
ill-configured Netscape and Eudora) have incorrect MIME-header and wrong
fonts(those for Western European charsets) are used by MS Internet Mail to
display them and Hangul is illegible, in which case you can double-click on
the message in question, open 'detailed-view' window where you have to
choose 'Korean' for language in 'view' menu. (You can also use AsianView
mentioned above on top of Hangul MS Windows to avoid this problem). Another
complication arises when replying to those messages with incorrect header.
In detailed-view window, use 'forward' instead of 'reply' and manually put
the address of the recipient (and change 'Fwd:' in Subject to 'Re:').
Otherwise, Hangul will not be visible in composing window for reply.
[Contribution by Lee,Jae-ho at kamisama@kt.rim.or.jp and Yi,Yeong-Deug at
queen@yes.snu.ac.kr]

Newer versions of mail clients from Microsoft such as those included in MS
Internet Explorer 4.0(OutLook Epxress) and MS-Office Pro 7.0(MS Outlook 97)
are reported not to have the problem of solely depending on the value of
charset parameter of Content-Type header to determine what font to use in
displaying Hangul news articles and to be able to handle incorrectly labeled
(as ISO-8859-1 instead of correct EUC-KR) articles posted by Netscape users.
To enable this feature in MS Outlook Express, iso-8859-1 needs to be
configured to converted to Korean in Tools|Options|Read|International
Setting. You also have to turn off EUC-KR to UTF-7 and UTF-8 conversion.
(UTF-7/UTF-8 are not widely supported, yet and UTF-7/UTF-8 encoded messages
are NOT readable by most other people) Outlook 97 users might have to
download outlook97.zip available at ftp://yes.snu.ac.kr/download/" and put
kor2022.trn, inetfe32.dll, and euckr.trn into Windows\System directory.
[Posted to han.comp.hangul by Yi, Yeong-deug at queen@yes.snu.ac.kr]

Subject 24 explains how to configure MS Outlook Express for Hangul Usenet
news posting. The same procedure can be taken for Hangul mail except that
you should NOT turn on 'Use 8bit characters in header' for Hangul mail. It's
a grave violation of Internet mail standard to send raw 8bit characters
without proper encoding. Some broken(non-MIME compliant) mail
clients(Eudora, non-MIME version of Elm,Berkelely /bin/mail) and mail
gateways (such mail-web gateway as HotMail and RocketMail) have difficulty
with RFC 2047-style encoded mail headers.(see below where the flaw of Eudora
is explained for the example of the header encoded following RFC 2047).
Rather than breaking the standard, you may as well ask those correspondents
of yours to get a more decent (MIME compliant) mail client. As mentioned
above, Kang, Kyungsoo and Lee, Jun Young have truly great web pages about
Hangul mail configurations for MS Outlook Express and Netscape Communicator.
They're at

o http://skyhawk.i.ml.org/oesetup/oesetup-image.htm
o http://www1.hitel.net/dong/o/osc.html

In Usenet newsgroup han.news.users, Lee JunYoung (leejuy@hyowon.pusan.ac.kr)
explained how to configure MS Outlook Express for Hangul Usenet newsgroup
posting. (as mentioned above, it's in Subject 24) Below is the summary of
his posting a little modified for Hangul mail. Please, note that internet
mail and usenet news have similar but not identical convention and/or
standard.

1. On the Tools menu, select Options
2. Click on the Send tab
3. Under Mail sending format, choose plain text (never choose HTML unless
you're sure your correspondents can read HTML formated messages) and
click Apply or OK.
4. In the dialog box for plain text configuration, check MIME(for text
posting, uuencode doesn't make much difference, but putting the proper
MIME header is better)
5. Set text encoding to None. In case this doesn't work for some
correspondents, try again with this set to Base64(MIME). You would leave
this set to NONE and wouldn't have to tinker with this option if MS
Outlook Express and all MAs(mail agents) in-between abided by Internet
Mail Standard. Unfortunately, MS Outlook Express violates RFC 1652 as
does some MTAs pretty widely deployed in Korea(Hangul sendmail 8.8)
6. Turn OFF 'Use 8bit characters in header' and press OK button. If your
correspondent is one of the unfortunate to rely on such broken mail
services as RocketMail and HotMail, you may wish to turn this ON.

Additionally, you may want to get it to use English header when replying in
Tools|Options|Read|International Settings.

Netscpae 4.0x(aka Communicator) mail supports display of messages in
ISO-2022-KR. Using it relieves many users with very little knowledge of
Hangul code and encoding of trouble of manually converting Hangul message in
ISO-2022-KR or setting up procmail to do automatic conversion. Korean should
be selected in Options|Document Encoding for automatic conversion of
messages in ISO-2022-KR back to EUC-KR. HTML composition should be turned
OFF(in Edit|Preference|Mail&Groups|Messages) unless you want to send some
hypertext documents. It's a waste of precious network resource and
annoyiance to your correspondents without means to read HTML message to send
plain text message in both html and plain text format as is the case when
HTML composition is turned ON in Netscape 4.0

The final release version of Netscape 4.0x solved most of problems in 4.0b1
and b2 related with Hangul. There are some points to keep in mind using
netsape 4.0 for Hangul mail and News. Hangul MS-windows users and English
MS-windows users with Unionway must make sure that Encoding is set to
Korean(autodetect) in View|Encoding. Many people make a mistake of setting
this option to Western (Latin1) which is for Western European languages.
This results in the following header inappropriate for Korean mail and news
messages.

Content-Type: text/plain; charset=iso-8859-1

The correct header for Korean news article and mail message(in EUC-KR) is

Content-Type: text/plain; charset=EUC-KR

and that for Korean mail message(in ISO-2022-KR) is

Content-Type: text/plain; charset=ISO-2022-KR

Eudora made by Qualcomm which will collect 350 millon dollars of royalty
from Korea for its CDMA technology over next 5 years does not support Korean
mail in that it doesn't decode RFC 2047-compliant header encoding with
EUC-KR(Korean MIME charset) as shwon below. MS-Windows version of Eudora
users may be able to view RFC 2047 style headers by installing AsianView or
Unionway(AsianSuite). Refer to Subject 4 and 38 for more information on
these products.

=?EUC-KR?B?SGFuWL/NIMfRsdsgxvnGrg==?=

Only MIME charset recognized by Eudora is ISO-8859-1 for Western Euroepean
languages. Accordingly, there's no way to put EUC-KR in the charset
parameter of Content-Type header which is necessary to properly identify
that messages are in Korean. Work-around has been made for Mac version by
eudora users whose native languages are not covered by ISO-8859-1
(Swede,Greek,Russian as well as Korean and Chinese) and can be obtained at
http://www.hf.uib.no/smi/files/eudtab.html. The information was kindly
forwarded to me by Andreas Prilop at april@macb033.rrzn.uni-hannover.de.

Yi, Yeong-Deug also came up with a work-around for the probleem of Eudora
for MS-Windows which puts ISO-8859-1 in Content-Type header regardless of
actual charset used. Header information can be adjusted for Korean mail
exchange using sort of psuedo-SMTP server for Windows 95 and NT 4.0,
maillita available at http://huizen.dds.nl/~maillita. For details on how to
configure it for Korean mail exchange with Eudora and other mail programs
which don't allow charset name other than ISO-8859-1 that is Western
European charset, see Yi, Yeong-Deug's Hangul Mail FAQ page aforementioned
at http://yes.snu.ac.kr/queen/hmailfaq.htm.

MS-Exchange treats messges in 8bit EUC-KR(with Content-Type text/plain;
charset=EUC-KR and Content-Transfer-Encoding: 8bit) as atteachment. It can
be displayed by double-clicking and choosing Korean as the language. More
convenient is copy a file below to system directory in the directory
where Windows is installed(e.g. C:\windows\system) after
uudecoding.[Contribution by Yi,Yeong Deung at queen@yes.snu.ac.kr.]

begin 600 euckr.trn
M5$Y%54,M2U(`````````````````````````````````````````````155#
M+4M2*$)!4T4V-"D``````````````````````````````````! 0`0`!`@,$
M!08'" D*"PP-#@\0$1(3%!46%Q@9&AL<'1X?("$B(R0E)B
M7V!A8F-D969G:&EJ:VQM;F]P<7)S='5V=WAY>GM\?7Y_@(&"@X2%AH>(B8J+
MC(V.CY"1DI.4E9:7F)F:FYR=GI^@H:*CI*6FIZBIJJNLK:ZOL+&RL[2UMK>X
MN;J[O+V^O\#!PL/$Q<;'R,G*R\S-SL_0T=+3U-76U]C9VMOKK[.WN[_#Q\O/T]?;W^/GZ^_S]_O]N=! !``$"`P0%!@<("0H+# T.
M#Q 1$A,4%187&!D:&QP='A\@(2(C)"4F)R@I*BLL+2XO,#$R,S0U-C'EZ>WQ]?G\_/RP_/S\_/UX_/S\_/S\_/R+CY.7FY^CIZNOL[>[O
0\/'R\_3U]O?X^?K[_/W^_]/4
`
end

When sending messages to Korean online service, Unitel, one has to be very
careful to avoid their messages encoded in Base64 or Quoted-Printable as
Unitel can't handle Base64/QP encoded messages although it's specified in
RFC 2045(to be a Internet Standard) and is supported by numerous other
programs. Those abroad using POP3 clients like Netscape 3.0 and Eudora, and
Forte Agent with their mail servers faithfully conformant to RFC 1652 CANNOT
avoid this unless their mail programs allow them to send Hangul messages in
ISO-2022-KR/7bit. (Netscape 4.0, Pine 3.9x + hmconv, Korean version of
MS-Internet Mail, HanMutt are a few examples of those programs). The best
way to solve the problem is urge Unitel to support the standard and decode
incoming Internet mail in Base64/QP to 8bit by installing the newest version
of sendmail(sendmail 8.8.8 as of December, 1997).

If you think all of these configurations are too much hassle, you may wish
to get an account at web-based Hangul mail services in Korea and ask your
friends to direct Hangul mail there. One of them is Kebi Web mail at
http://mail.kebi.com

Usenet Newsgroup han.comp.mail is a good place to post your questions
regarding Hangul mail exchange.

 

Continue to:













TOP
previous page: 8. What are KS X 1001(KS C 5601) and other Hangul codes?
  
page up: Hangul & Internet in Korea FAQ
  
next page: 10. Is there any Hangul Internet BBS?