Hi,

At Sun, 13 Jan 2002 03:12:44 +0900,
Tomohiro KUBOTA wrote:

> I think luit uses JIS X 0212 (i.e., G3 character set) via GL.
> This is not true.  EUC-JP uses JIS X 0212 via GR.

I think I found the reason.  In luit, SS2 and SS3 are implemented
to invoke G2 and G3 to GL.  However, I have read a textbook that
SS2 and SS3 are re-defined by ISO 2022 to invoke G2 and G3 to
_both of GL and GR_.  I imagine this modification is for EUC
encoding scheme to be compliant to ISO 2022.

Here is a patch to enable _displaying_ JIS X 0212 in EUC-JP, by
following the re-definition I wrote above, by modifying copyOut()
in iso2022.c .  However, I don't know my patch is complete because
I don't know the internal of luit very well.

Note that luit with my patch yet has a problem around G3 in EUC-JP.
Though I think this can be done within copyIn() in iso2022.c ,
a new flag whether G2/G3 is mapped into GL or GR (with SS2/SS3)
may be needed because usage of GR is an exception in EUC encoding
scheme.  The problem can be shown like this:

$ xterm -u8
$ LANG=ja_JP.eucJP luit
$ echo -e '\361\326\217\351\321'
<><>  (two Kanji characters, the 2nd one is from JIS X 0212)
$ echo <><> | od -t x1
0000000 f1 d6 8f 69 51 0a
                 =====

"69 51" should be "e9 d1" here.


I have not tested G2 in EUC-JP, i.e., JIS X 0201 Kana (halfwidth
kana).  It seems that xterm+luit does not work with JIS X 0201 at
all....

--------------- patch from here
--- iso2022.c   Sun Dec 23 20:07:24 2001
+++ iso2022.c.new       Sun Jan 13 11:04:46 2002
@@ -628,7 +628,12 @@
                     else
                         code = -1;
                 } else {
-                    charset = GR(is);
+                    switch(is->shiftState) {
+                    case S_NORMAL: charset = GR(is); break;
+                    case S_SS2: charset = G2(is); break;
+                    case S_SS3: charset = G3(is); break;
+                    default: abort();
+                    }
                     ku_code = is->buffered_ku - 0x80;
                     if(*s >= 0x80)
                         code = *s - 0x80;
--------------- patch until here

---
Tomohiro KUBOTA <[EMAIL PROTECTED]>
http://www.debian.or.jp/~kubota/
"Introduction to I18N"  http://www.debian.org/doc/manuals/intro-i18n/
_______________________________________________
I18n mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/i18n

Reply via email to