[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CJK(Chinese, Japanesse and Korean) support in shell.
[This post is me doing my best Strunk ("If you don't know how to say a
word, say it loud!" x 2), so please correct my ignorances and augment my
half-truths]
On Mon, Oct 31, 2005 at 10:54:18AM +0800, Mat wrote:
> I have currently made a mini bootable linux of mine which includes linux
> kernel 2.6.11(UTF8 and the 4 code pages for CJK enabled)
I think all of that enableage only affects the console interface. By the
time you're in X, you're in a different world.
> an NCURSES based application.
That's going to potentially be a problem - there are two ncurses libs -
ncurses and ncursesw. The second one has "wide" char support - which is
meant in the physical sense of "wide" (as opposed to the "wide byte"
meaning). If you don't have ncursesw in use, and you try to draw a rectangle
around some double-wide chinese char, ncurses will miscompute the width of
the rectangle.
To chech to see if any particular app is linked against the right one, just
do an `ldd /usr/bin/foo`.
If it's not linked against ncursesw, check ./configure for such an option,
or munch on the Makefile a bit.
> I would like to display string resources which are CJK on my shell or the
> NCURSES interface.
You'll need:
- a terminal that doesn't chork when it sees UTF-8 (properly compiled
xterms are good for this, these days)
- fonts that cover all the code points for the characters you want to
display. This can be tricky. Check out:
http://eyegene.ophthy.med.umich.edu/unicode/fontguide/
> What steps do i have to perform to make this CJK display possible. I am
> using the stripped down version of bash which is ash(available in busybox).
I don't have handy access to ash at the moment, but bash does a great job
with UTF-8 characters that I've seen. Really, the shell doesn't have to
have a whole lot of smarts to display this stuff well - the only piece I
can think of that fails (e.g. in my favorite shell, zsh) is the
command-line editor.
HTHALB,
-rjk
--
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/