![]() |
![]() |
Articles / TULARC / Languages / Korean / | ![]() |
|
![]() |
||||
![]() |
![]() |
|||
![]() |
![]() |
|||
![]() |
||||
|
|
||||
![]() |
![]() |
|||
![]() |
36. How can I view Hangul world wide web (WWW) pages under Unix /X window? |
![]() |
||
![]() |
||||
![]() |
![]() |
![]() |
||
![]() |
||||
![]() |
![]() |
![]() |
![]() |
||
![]() |
||
![]() |
![]() |
![]() |
![]() |
||
|
|
||
![]() |
||
![]() |
![]() |
![]() |
![]() |
||
![]() |
||
This article is from the Hangul & Internet in Korea FAQ, by Jungshik Shin jshin@minerva.cis.yale.edu with numerous contributions by others.
Under Hangul-capable environment as summarized below and dealt with in depth
above, you should have little problem viewing Hangul Web pages in and
outside Korea. In case further help is necessary, you may post your question
to Hangul USENET Newsgroup(See Subject 24), han.comp.www.browsers,
hangul.comp.hangul or news groups for each flavor of Unix like Linux,Sun,
and HP listed in Subject 24
o Netscape 2.0b2 or later with Hangul Wansung(pre-composed) fonts. See
below for details. It's the easiest way.
o PXHan(Pseudo X for Hangul display) and any web browser(including Netscape)
for X Window. You may as well set font-style (in Options-Preference menu)
to Huge in Netscape to get Hangul displayed intact. See Subject 6) and
reference there for further details. It's left here for historic reason
ONLY and you're strongly advised NOT to try this any more.
o Multi-localized version of Mosaic(L10N Mosaic made at NTT) + Hangul
fonts(daewoo font or any 'pre-completed font') under most incarnations of
Unix(?Unices?) and X11 implementations. Input is not allowed. More
information on L10N Mosaic is found at
http://www.ntt.jp/Mosaic-l10n/README.html.
o Any Web browsers for X dynamically linked to X11 shared library with
original libX11 replaced by libHanX11(Hangul patched X11 shared library,
HanX). Most versions of Mosaics are available with dynamic link(or you
may compile it yourself if you have Motif library since source for Mosaic
is avaialbel on the Net) while it's NOT the case with Netscape except on
SGI Irix 5.2 for which Netscape is known to be dynamically linked with
X11 shared library.. In case you happen to have a binary of Netscape
dynamically linked to libX11, it must be possible to read and write
Hangul in Netscape with HanX. Perhaps,Emacs in W3 mode also allows Hangul
I/O this way.
o Hanterm + any text browsers(e.g. Lynx)(In recent versions of Lynx, you
have to set Charset to Koearn in Option menu which you can get to by
pression O
o Any terminal emulators for X(e.g. xterm, provided they're dynamically
linked to X11 shared library),with libHanX11(HanX) installed + any of
text browsers like Lynx.
o Mule(at ftp://sh.wide.ad.jp/JAPAN/ Extension of Emacs
v.19),GNU Emacs 20, or Xemacs 20(+mule)(See Subject 3 for more details on
various versions of Emacs) in W3 mode. See http://www.ntt.jp/Mule
o Hanemacs supports W3 mode and can be used as a Hangul-viewable web
browser. I tried this with Hemacs2.0beta under Linux and it worked well.
o Any terminal emulator under Hangul capable MS-DOS,MS-Windows, and Mac OS
used to connect to Unix host + text browsers like Lynx. See Subject 4 and
Subject 5, respectively for Hangul-capable environment for MS-DOS/Windows
and Mac.
Netscape 2.0 or higher are able to display Hangul and Hanja in one of two
encodings of KS C 5601 and US-ASCII/KS C 5636, 8bit EUC-KR and 7bit
ISO-2022-KR(See Subject 8 for Hangul code) as long as Hangul
fonts(Wansung-pre-composed- fonts like Daewoo and Hanyang) are installed on
X server(See Subject 6 for Hangul fonts). Here's a quick recipe to view
Hangul in Unix/X version of Netscape.
1. Get and install Hangul Wansung fonts on your X server or X font server
See Subject 6 for details on how to install Hangul fonts for X window.
With X font server feature of X11 R6, Hangul fonts can be made avaiable
even to X terminal users without the previlege of the system
administrator.
2. In Options, set Document Encoding(in Netscape 4.03, it's under View
instead of Options) to Korean(EUC-KR). In Netsacpe 4.0, it's
Korean(AutoDetect).
3. In Options|GeneralPreference|Fonts, set fonts to use with Korean to one
of Hangul fonts. Choose Korean(ks_c_5601-1987) at 'For the Encoding', and
set proportional and fixed font to one of Hangul fonts installed in step
1. Please, note that Korean would not appear if you don't have any Hangul
fonts(Wansung) on your X server/X font server. You need to install Hangul
fonts before this step.
4. To make this change permanent(i.e. make Korean the default encoding), you
have to save options by choosing Save Options in Options menu (In 4.0,
choose Set Default Encoding in View | Encoding).
In case you are satisfied with Hangul properly displayed only in main text
window, you may as well stop here. Other areas where Hangul needs to be
displayed can be classified into two categories. Those of the first category
are all the places where text is displayed (bookmark,mail and news list,etc)
except for the title bar of the window where Netscape is enclosed which
belongs to the second.
There are a few ways to display Hangul in those areas of depending on
whether Korean locale - either X locale or C library- is available and how
Netscape for that platform is compiled.
The simplest(?) of them is install HanX (Hangul patched X library) by Oh,
Sung-gyu. HanX is kind of hack with nothing to do with X11 I18N
(Internationalization). It requires no locale support, C library or X and
can be very useful for those abroad where Korean locale is not installed on
their machines. With HanX replacing the original X11 shared library, Hangul
input as well as output in both categories mentioned above is possible even
without Hangul Input Method server (which is usually not available on Unix
machines sold outside Korea with possible exception of Digital Unix). HanX
users may also localize their Netscape (making all menus and messages appear
in Korean) using application default resource files mentioned below. Make
sure that font specifications for ks_c_5601-1987 in all fontList resources
are removed when localizing Netscape where HanX is used. Problem with this
approach is pre-compiled binary for HanX is only available for the limited
set of platforms(Linux, FreeBSD, and Sun OS 4.x) although it's not so hard
to build it from X11 R6.x source tree. See Subject 6 for more information on
HanX and Hangul in Unix/X environment.
In case Korean locale is supported by C library on your platform and is
installed by your system administrator, you may install Korean version of
Netscape 3.0x with most of Motif messages translated into Korean.Most
versions of Unixen that come with workstations sold in Korea such as
Sun,Digital,HP,IBM,SGI have Korean locale support at the C library level. So
does FreeBSD among free Unixen. Except for Digital Unix, commercial Unixen
sold outside East Asia don't include Korean locale by default and you have
to pay for it separately. Korean version of Netscape is available at
http://home.netscape.com/ko/. Korean version is nothing more than a English
version with modified application default file with Motif resources for
Hangul messages. README file in Korean version says that the file
Netscape.ad should be renamed Netscape and put in the directory only
system administrator has access to (e.g.
<XROOT>/X11/locale/app-defaults/ko), but that's not actually the case. Your
home diretory,ko or ko_KR.euc in your home directory, the directory named by
the environment variable XRESAPPLDIR(don't forget the trailing '/' when
naming this variable) and ko or ko_KR.euc under it can be used as well. When
running Netscape, the environment variable LC_CTYPE and/or LANG has to be
set for Korean locale(ko and ko_KR.euc). The exact path and the value of
LANG or LC_CTYPE environment variables may vary depending upon the flavor of
Unix,the version of X11 for which Netscape is compiled and the Korean locale
name on the machine. When setting either of two environment variables(LANG,
LC_CTYPE), you need to make sure that the other is left set to non-Korean
value like iso_8859_1 or de,us.
Some people including Ryu, Byoung Soon at bsryu@paradise.kaist.ac.kr and
Kim,Bum Chul at quantum@brain.tgmi.co.kr, independently of Netscape, made a
localized version of netscape by translating messages into Korean and posted
their modifications to Hangul Usenet newsgroup(See Subject 24
)han.sys.linux(now han.comp.os.linux) and han.comp.www(now splitted to
several groups). Choi, Junho at junker@jazz.snu.ac.kr put his translation on
the Web at http://jazz.snu.ac.kr/~junker/work/netscape3-hanmsg/ where
detailed instruction is given. Similar information is available at
http://members.iWorld.net/bumchul/kims.html and
http://www.mizi.co.kr/hanIM/netscape.html.
Choi, Jun-Ho put up a nice web page with gory details on Netscape and Hangul
for Unix/X11 at http://jazz.snu.ac.kr/~junker/work/netscape-ko. Especially
noteworthy of this page is it has almost completely(over 95%) localized
version of Netscape 4.07 for Korean. With little modification, it can be
used along with Netscape 4.5 as well.
You may customize the application default file for your need. For instance,
you may not want Korean messages, but like to see Hangul in menu,bookmark
and mail/news list. The minimum change required in that case is delete
(easier way is replace all the occurences of the string "fontList" with
"DISABLE_fontList" in Netscape.ad) all the lines with fontList resources in
Netscape.ad for English version and add the following to it. Other resources
with fontList in their names(e.g. XmLGrid*fontList,
XmTeXTField*fontList,menuBar*fontList) can be modified in a simliar way(i.e.
add a font to be used for KS C 5601 separated by ';' from that for
ISO-8859-1).
Netscape*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-*;\
-hanyang-kodig-medium-r-normal--14-140-72-72-c-140-ksc5601.1987-0:
Netscape*XmLGrid*fontList:\
-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*;\
-hanyang-kodig-medium-r-normal--12-120-72-72-c-120-ksc5601.1987-0:
Resources used by Netscape are well documented in Netscape.ad included in
Netscape and their names are quite informative to enable you to tell which
is used where. Alternative to editing the application default resource file
highly dependent on a specific version of Netscape is append ) the lines
above (with "Netscape*" in front of every line if you wish this resources
setting not to be used by other Motif applications) to
.Xdefaults/.Xresources in your home directory or a X resource file named by
the environment variable XENVIRONMENT. Other Hangul font needs to be
specified depending on Hangul fonts installed.
There are some resources not documented in Netscape.ad and not controlled by
setting *fontList resource. I figured out what they are using
editres(available in standard X11 distribution). You may have to add
following resources(at least for Netscape 4.0x) to your Netscape application
default file or .Xdefaults/.Xresources or the file named by XENVIRONMENT
variable. Some resources below are documented in Netscape.ad while others
are not. This list is not exhaustive. On the other hand, some of these might
be superfluous. (Please, note that the following examples assumes you have a
set of Web batang fonts modified by the recipe given in Subject 6. You can
use any other Hangul fonts of appropriate size you have, instead). You may
also preceed all the resources name with Netscape to make sure that they're
applied to Netscape.
*XmLGrid*fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmTextField.fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmText.fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmList*fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmLabel*fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmForm*fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*tipLabel.fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmPushButton.fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmToggleButton.fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmPushButtonGadget.fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
*XmCascadeButtonGadget.fontList:\
-*-helvetica-bold-r-*-*-*-120-*--*-*-iso8859-*;\
-ksh-hymjsm2-bold-r-normal--12-90-100-100-c-120-ksc5601.1987-0:
According to Choi, Jun-Ho, in Linux and FreeBSD version of Netscape, you
also need to install KS X 1001 GR encoded fonts(of which XLFD name end with
ksc5601.1987-1 instead of ksc5601.1987-0) to get Hangul displayed
correctly in Form button and to set fonts for the encoding x-ksc5601-11 to
GR encoded fonts. Several sets of GR encoded fonts are available from Mizi
Research(follow the link for hanIM) at http://www.mizi.co.kr/ and KIMS
distribution(see Subject 6).
With LANG/LC_CTYPE set to ko/ko_KR.euc on a host where Korean locale is
supported, you will find weired strings(e.g. $(C0!3*4Y $BABC
$(C0!3*4Y ) displayed in the title bar of the window enclosing
Netscape. This belongs to what I calls the second category of places where
Hangul needs to be displayed. It's not under the control of Netscape, but
governed by your Window manager. You need to use either
localized(L10N:Hangul patched) or internationalized(I18N) window manager.
Among them are mwm(motif window manager) included in Motif, fvwm95 and
afterstep patched for Hangul by Choi,Jun-ho at junker@jazz.snu.ac.kr, I18Ned
afterstep,and qvwm(See Subject 6 for more information on I18Nized window
managers)
This setting work well on 75 dpi display, but with a monitor of resolution
far off 75 dpi(e.g. 100dpi) , you have to tinker with font size for Hanyang
fonts until you come up with appropriate setting. You have to install
Hanyang fonts including alias mentioned below to make these resources work.
Otherwise, you would get the error message about resolution of 'FontString'
to font.
Note that you may NOT use 'Johab' fonts included in Hanterm in Netscape
unless you install and run a hangul xfont server made by Moon Hongsuk(see
Subject 6 for details) which presents Iyagi Johab fonts as Wansung fonts to
X application. Unfortunately, the source code is not available and only
Linux binary is available. By adding Hangul X fonts(it should be Wansung
type. See Subject 6 for freely available Hangul fonts ) other than Daewoo
fonts(e.g. Hanyang fonts), you may get better Hangul display. When
installing Hanyang fonts, you have to append a file 'aiias' distributed with
Hanyang fonts to a file 'fonts.alias' in the directory you installed them(a
directory under your home directory or system-wide font directory such as
<XROOT>/lib/fonts/misc. For the former, you just have to copy 'alias' to
'fonts.alias'). This file, 'alias' contains font aliases to make Hanyang
fonts(monospace fonts) recognized as 'character-cell fonts' as well. Thus,
without this Hanyang fonts would not be available for propotional fonts menu
in Netscape.
One may also use the localized application default file for Netscape on a
platform without Korean locale support at the C library level if the X
locale datafile for Korean(X11R6 include it by default and most hosts with
full installation of X11R6 have it) is installed and X server, X shared
library and Netscape are compiled with X_LOCALE defined. Netscape references
X locale instead of C library locale on such a platform. Unfortunately,
there seems to be no such platform. Netscape 3.0 and later for Linux which
is compiled without X_LOCALE defined, however, can be made to make use of
locale files included in X11R6 instead of looking for missing C library
locale files as XF86 server and XF86 shared lib(libX11) for Linux are
compiled with X_LOCALE defined. Kim, Bumchul at quantum@brain.tgmi.co.kr
found a following recipe in a Japanese newsgroup to get Netscape under the
impression that C library locale for Korean is installed. It was originally
devised for Japanese, but can be applied to Korean and Chinese for which
locale support at C library level is not available in Linux.
This recipe might be applied to other flavors of Unixen if you're familiar
with the target platform especially as to what option the linker has to be
given to generate a shared library and how to preload a function in shared
libraries.(defining LD_PRELOAD works in Linux and Sun OS 4.x and 5.x but as
for other Unixen, either the mechanism is not available or you have to
figure out how to). You also have to build X server and libX11 with X_LOCALE
defined out of the source tree if they're built wihtout X_LOCALE defined.
All of these are not trivial tasks at all for most users and it'd be much
easier and more hassle-free to persuade your system administrator to install
the C library locale for Korean.
1. Compile the source code included below with following command
gcc -fPIC -shared -Wl,-rpath=/usr/X11R6/lib,-soname,liblocale.so \
-o liblocale.so locale.c -L/usr/X11R6/lib -lX11 -lXt
2. Copy liblocale.so to /usr/local/lib/netscape
3. Get Netscape.ad (application default file) for Korean(either from Korean
Netscape for any flavor of Unix at Netscape ftp/web site or Choi, Junho's
web site mentioned above) or modify one for English to fit your
preference as mentioned above.
4. Copy Netscape.ad to <XROOT>/lib/X11/locale/ko/app-defaults/Netscape
5. Make the following shell script and put it in your search path
6. Use this script to launch netscape.
#!/bin/sh
NS_EXE=/usr/local/bin/netscape
#the directory where you put liblocale.so
#and libc.so.5.2.18. The latter is only required for Netscape 3.x
#and not necessary for Netscape 4.0
NS_LIB=/usr/local/lib/netscape
LD_PRELOAD=$NS_LIB/liblocale.so:$NS_LIB/libc.so.5.2.18"
LANG=ko
export LANG
export LD_PRELOAD
exec $NS_EXE $*
------------ cut locale.c -----------------
/* locale.c for Linux
gcc -fPIC -shared -Wl,-rpath=/usr/X11R6/lib,-soname,liblocale.so \
-o liblocale.so locale.c -L/usr/X11R6/lib -lX11 -lXt
LD_PRELOAD=/lib/liblocale.so netscape */
#include <locale.h>
#include <X11/Intrinsic.h>
char *_Xsetlocale (int, const char *);
#undef setlocale
char *setlocale (int c, const char *l)
{
if ((c == LC_ALL || c == LC_CTYPE) && l != NULL
&& !(*l == 'C' && l[1] == '\0')) {
XtSetLanguageProc(NULL, NULL, NULL);
l = NULL;
}
return _Xsetlocale(((c == LC_ALL || c == LC_CTYPE) ? 2 : 3), l);
}
------------ cut locale.c -----------------
 
Continue to:
languages, Hangul, Internet, Korea, ISP, Mac, Unix, MS-Windows, X Window, MS-DOS, WWW
![]() |
|
|