lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev changes for Japanese


From: Hataguchi Takeshi
Subject: lynx-dev changes for Japanese
Date: Sat, 12 Feb 2000 11:39:50 +0900 (JST)

I updated my changes for Japanese.
I merged all my changes for 2.8.3dev.18 into one patch, 
so please apply this patch to original 2.8.3dev.18 sources.

The main changes are:
(1) If Japanese document's charset is specified explicitely
    by the MIME tag or HTTP responses, Lynx will assume the charset
    as it.

(2) Change the Japanese charset detection strategy when chaset
    isn't specified explicitely.

(3) wrap a long text which includes only CJK characters in source mode.

(4) avoid to write CJK characters at the 80th column.

(5) improve kanji code override routine
    # My change seemes to have broken this

(6) introduce new macro CONV_JISX0201KANA_TO_JISX0208KANA
    and ALLOW_KANJI_CODE_OVERRIDE.

(7) change the phrase "half width kana" to "JIS x0201 Kana" in comments.
    # The latter has been used originally.

(8) enable assume_charset when display charset and assume charset
    are Japanese. assume_charset acts like charset by META tag
    only when charset isn't specified by META nor HTTP responses.

(9) change the behavior of the option menu.
    For example, when display charset is Japanese (EUC-JP) and
    CJK mode is on, changing assume_charset from iso-8859-1 to
    shift_jis using the option menu,
        old behavior:
            assume_charset won't be changed.
            CJK mode will turn off.
        new behavior:
            assume_charset will be changed to shift_jis
            CJK mode won't be changed.

(10) Improve handling Japanese in Visited Links Page, History Page
    and pages with FORM.

(11) change macro name: ALLOW_KANJI_CODE_OVERRIDE -> KANJI_CODE_OVERRIDE.

# (1) to (7) are from my mail on 16 Jan, (8) and (9) are on 23 Jan, 
# and the rest are new.

The macros are:
    USE_TH_JP_AUTO_DETECT
        enable (2)

    CONV_JISX0201KANA_TO_JISX0208KANA
        convert JIS X0201 Kana to JIS X0208 Kana,
        i.e. convert half width kana to full width.
        I've not tested the case not to define this well.

    KANJI_CODE_OVERRIDE
        enable kanji code override routine.
        The code can be changed by ^L.
        More precisely, this enables us to change the assumption kanji
        code for the document. This assumption overrides the charaset
        by META tag and HTTP responses.

These changes can be tested without CJK_EX nor SH_EX.
I want the first two macros to be default and the last one not to be.
For someone who likes half width kana,
it may be good to define KANJI_CODE_OVERRIDE and not to define
CONV_JISX0201KANA_TO_JISX0208KANA, but this may be a little bit buggy.
--
Takeshi Hataguchi
E-mail: address@hidden

diff -ru orig/lynx2-8-3/WWW/Library/Implementation/HTCJK.h 
lynx2-8-3/WWW/Library/Implementation/HTCJK.h
--- orig/lynx2-8-3/WWW/Library/Implementation/HTCJK.h   Sat Jul 31 00:39:54 1999
+++ lynx2-8-3/WWW/Library/Implementation/HTCJK.h        Sun Jan 16 15:13:28 2000
@@ -37,11 +37,21 @@
 #define IS_SJIS_HI1(hi) ((0x81<=hi)&&(hi<=0x9F))       /* 1st lev. */
 #define IS_SJIS_HI2(hi) ((0xE0<=hi)&&(hi<=0xEF))       /* 2nd lev. */
 #define IS_SJIS(hi,lo,in_sjis) 
(!IS_SJIS_LO(lo)?0:IS_SJIS_HI1(hi)?(in_sjis=1):in_sjis&&IS_SJIS_HI2(hi))
+#define IS_SJIS_2BYTE(hi,lo) 
(IS_SJIS_LO(lo)&&(IS_SJIS_HI1(hi)||IS_SJIS_HI2(hi)))
+#define IS_SJIS_X0201KANA(lo) ((0xA1<=lo)&&(lo<=0xDF))
 
+#if 0 /* IS_EUC_LOS isn't used because we are interested only in EUC-JP's
+       * code set 0 to 2 now. -- TH
+       * ref: http://www.isi.edu/in-notes/iana/assignments/character-sets
+       */
 #define IS_EUC_LOS(lo) ((0x21<=lo)&&(lo<=0x7E))        /* standard */
+#endif
 #define IS_EUC_LOX(lo) ((0xA1<=lo)&&(lo<=0xFE))        /* extended */
 #define IS_EUC_HI(hi)  ((0xA1<=hi)&&(hi<=0xFE))
-#define IS_EUC(hi,lo) (IS_EUC_HI(hi) && (IS_EUC_LOS(lo) || IS_EUC_LOX(lo)))
+#define IS_EUC_X0201KANA(hi,lo) ((hi==0x8E)&&(0xA1<=lo)&&(lo<=0xDF))
+#define IS_EUC(hi,lo) ((IS_EUC_HI(hi) && 
IS_EUC_LOX(lo))||IS_EUC_X0201KANA(hi,lo))
+
+#define IS_JAPANESE_2BYTE(hi,lo) (IS_SJIS_2BYTE(hi,lo) || IS_EUC(hi,lo))
 
 #define IS_BIG5_LOS(lo)        ((0x40<=lo)&&(lo<=0x7E))        /* standard */
 #define IS_BIG5_LOX(lo)        ((0xA1<=lo)&&(lo<=0xFE))        /* extended */
diff -ru orig/lynx2-8-3/WWW/Library/Implementation/SGML.c 
lynx2-8-3/WWW/Library/Implementation/SGML.c
--- orig/lynx2-8-3/WWW/Library/Implementation/SGML.c    Fri Jan  7 12:02:22 2000
+++ lynx2-8-3/WWW/Library/Implementation/SGML.c Sat Jan 22 09:07:18 2000
@@ -39,9 +39,11 @@
 # include <LYPrettySrc.h>
 #endif
 
+#if 0
 #ifdef CJK_EX  /* 1997/12/12 (Fri) 16:54:58 */
 extern HTkcode last_kcode;
 #endif
+#endif
 
 #define INVALID (-1)
 
@@ -157,6 +159,7 @@
                S_esc_dq, S_dollar_dq, S_paren_dq, S_nonascii_text_dq,
                S_dollar_paren_dq,
                S_in_kanji, S_junk_tag, S_junk_pi} state;
+    unsigned char kanji_buf;
 #ifdef CALLERDATA
     void *                     callerData;
 #endif /* CALLERDATA */
@@ -1473,10 +1476,10 @@
     ** we can revert back to the unchanged c_in. - KW
     */
 #define unsign_c clong
-#ifdef CJK_EX  /* 1997/12/12 (Fri) 18:08:48 */
+#if 0
     static unsigned char sjis_1st = '\0';
-    unsigned char sjis_hi, sjis_lo;
 #endif
+    unsigned char sjis_hi, sjis_lo;
 
     c = c_in;
     clong = (unsigned char)c;  /* a.k.a. unsign_c */
@@ -1690,6 +1693,9 @@
        HTCJK == NOCJK)
        goto after_switch;
 
+#if 0  /* This JIS X0201 Kana to JIS X0208 Kana conversion is/should be
+        * done in the HTextAppendCharacter. -- TH
+        */
 #ifdef CJK_EX  /* 1998/11/24 (Tue) 17:02:31 */
     if (HTCJK == JAPANESE && last_kcode == SJIS) {
        if (sjis_1st == '\0' && (IS_SJIS_HI1(c) || IS_SJIS_HI2(c))) {
@@ -1708,6 +1714,7 @@
        }
     }
 #endif
+#endif
 
     /*
     ** Ignore 127 if we don't have HTPassHighCtrlRaw
@@ -1727,6 +1734,24 @@
        !(PASSHICTRL || HTCJK != NOCJK))
        goto after_switch;
 
+    /* Almost all CJK characters are double byte but only Japanese
+     * JIS X0201 Kana is single byte. To prevent to fail SGML parsing
+     * we have to care them here. -- TH
+     */
+    if ((HTCJK==JAPANESE) && (context->state==S_in_kanji) &&
+       !IS_JAPANESE_2BYTE(context->kanji_buf,(unsigned char)c)) {
+#ifdef CONV_JISX0201KANA_TO_JISX0208KANA
+       if (IS_SJIS_X0201KANA(context->kanji_buf)) {
+           JISx0201TO0208_SJIS(context->kanji_buf, &sjis_hi, &sjis_lo);
+           PUTC(sjis_hi);
+           PUTC(sjis_lo);
+       }
+       else
+#endif
+           PUTC(context->kanji_buf);
+       context->state = S_text;
+    }
+
     /*
     ** Handle character based on context->state.
     */
@@ -1744,6 +1769,7 @@
        **  (see below). - FM
        */
        context->state = S_text;
+       PUTC(context->kanji_buf);
        PUTC(c);
        break;
 
@@ -1772,7 +1798,7 @@
            **  to having raw mode off with CJK. - FM
            */
            context->state = S_in_kanji;
-           PUTC(c);
+           context->kanji_buf = c;
            break;
        } else if (HTCJK != NOCJK && TOASCII(c) == '\033') {  /* S/390 -- gil 
-- 0881 */
            /*
@@ -4097,6 +4123,8 @@
            context->state = S_esc;
        }
        PUTC(c);
+       if (c < 32)
+           context->state = S_text;
        break;
 
     case S_esc_sq:     /* Expecting '$'or '(' following CJK ESC. */
@@ -4383,6 +4411,7 @@
 /*    context->extra_tags = dtd->tags + dtd->number_of_tags; */
     context->current_tag = context->slashedtag = NULL;
     context->state = S_text;
+    context->kanji_buf = '\0';
     context->element_stack = 0;                        /* empty */
     context->inSELECT = FALSE;
     context->no_lynx_specialcodes = NO;        /* special codes normally 
generated */
diff -ru orig/lynx2-8-3/src/GridText.c lynx2-8-3/src/GridText.c
--- orig/lynx2-8-3/src/GridText.c       Fri Jan  7 12:02:22 2000
+++ lynx2-8-3/src/GridText.c    Sat Feb 12 10:03:52 2000
@@ -100,8 +100,10 @@
 extern BOOL HTPassHighCtrlRaw;
 extern HTCJKlang HTCJK;
 
-#ifdef CJK_EX
+#ifdef KANJI_CODE_OVERRIDE
 PUBLIC HTkcode last_kcode = NOKANJI;   /* 1997/11/14 (Fri) 09:09:26 */
+#endif
+#ifdef CJK_EX
 #define CHAR_WIDTH 6
 #else
 #define CHAR_WIDTH 1
@@ -386,6 +388,16 @@
        STable_info *           stbl;
 
        HTkcode                 kcode;                  /* Kanji code? */
+       HTkcode                 specified_kcode;        /* Specified Kanji code 
*/
+#ifdef USE_TH_JP_AUTO_DETECT
+       enum _detected_kcode  { DET_SJIS, DET_EUC, DET_NOTYET, DET_MIXED } 
+                               detected_kcode;         /* Detected Kanji code 
*/
+       enum _SJIS_status     { SJIS_state_neutral, SJIS_state_in_kanji, 
+                               SJIS_state_has_bad_code } SJIS_status;
+       enum _EUC_status      { EUC_state_neutral, EUC_state_in_kanji, 
+                               EUC_state_in_kana, EUC_state_has_bad_code } 
+                               EUC_status;
+#endif
        enum grid_state       { S_text, S_esc, S_dollar, S_paren,
                                S_nonascii_text, S_dollar_paren,
                                S_jisx0201_text }
@@ -824,6 +836,12 @@
     HTMainAnchor = anchor;
     self->display_on_the_fly = 0;
     self->kcode = NOKANJI;
+    self->specified_kcode = NOKANJI;
+#ifdef USE_TH_JP_AUTO_DETECT
+    self->detected_kcode = DET_NOTYET;
+    self->SJIS_status = SJIS_state_neutral;
+    self->EUC_status = EUC_state_neutral;
+#endif
     self->state = S_text;
     self->kanji_buf = '\0';
     self->in_sjis = 0;
@@ -837,9 +855,8 @@
     /*
      *  Check the kcode setting if the anchor has a charset element. - FM
      */
-    if (anchor->charset)
-       HText_setKcode(self, anchor->charset,
-                      HTAnchor_getUCInfoStage(anchor, UCT_STAGE_HTEXT));
+    HText_setKcode(self, anchor->charset,
+                  HTAnchor_getUCInfoStage(anchor, UCT_STAGE_HTEXT));
 
     /*
      * Memory leak fixed.
@@ -1342,11 +1359,19 @@
                    buffer[1] = '\0';
                    data += utf_extra;
                    utf_extra = 0;
+#ifdef CONV_JISX0201KANA_TO_JISX0208KANA
                } else if (HTCJK != NOCJK && !isascii((unsigned 
char)buffer[0])) {
+#else
+               } else if (HTCJK != NOCJK && !isascii((unsigned char)buffer[0]) 
&&
+                          kanji_code != SJIS) {
+#endif
                    /*
                     *  For CJK strings, by Masanobu Kimura.
                     */
+                   if (i >= LYcols) goto after_while;
+
                    buffer[1] = *data;
+                   buffer[2] = '\0';
                    data++;
                    i++;
                    addstr(buffer);
@@ -1379,6 +1404,7 @@
        } /* end of switch */
     } /* end of while */
 
+after_while:
 #if !defined(NCURSES_VERSION)
     if (text->has_utf8) {
        LYtouchline(scrline);
@@ -1515,7 +1541,7 @@
     }
     move(0, 0);
     clrtoeol();
-#if defined(CJK_EX) && defined(SH_EX)
+#if defined(SH_EX) && defined(KANJI_CODE_OVERRIDE)
     addstr(str_kcode(last_kcode));
 #endif
     if (text->top_of_screen > 0 && HText_hasToolbar(text)) {
@@ -3498,6 +3524,100 @@
        text->halted = 3;
        return;
     }
+#ifdef USE_TH_JP_AUTO_DETECT
+    if ((HTCJK == JAPANESE) && (text->detected_kcode != DET_MIXED) &&
+       (text->specified_kcode != SJIS) && (text->specified_kcode != EUC)) {
+       unsigned char c;
+       int save_d_kcode;
+
+       c = ch;
+       save_d_kcode = text->detected_kcode;
+       switch (text->SJIS_status) {
+       case SJIS_state_has_bad_code:
+           break;
+       case SJIS_state_neutral:
+           if (IS_SJIS_HI1(c) || IS_SJIS_HI2(c)) {
+               text->SJIS_status = SJIS_state_in_kanji;
+           }
+           else if ((c & 0x80) && !IS_SJIS_X0201KANA(c)) {
+               text->SJIS_status = SJIS_state_has_bad_code;
+               if (text->EUC_status == EUC_state_has_bad_code)
+                   text->detected_kcode = DET_MIXED;
+               else
+                   text->detected_kcode = DET_EUC;
+           }
+           break;
+       case SJIS_state_in_kanji:
+           if (IS_SJIS_LO(c)) {
+               text->SJIS_status = SJIS_state_neutral;
+           }
+           else {
+               text->SJIS_status = SJIS_state_has_bad_code;
+               if (text->EUC_status == EUC_state_has_bad_code)
+                   text->detected_kcode = DET_MIXED;
+               else
+                   text->detected_kcode = DET_EUC;
+           }
+           break;
+       }
+       switch (text->EUC_status) {
+       case EUC_state_has_bad_code:
+           break;
+       case EUC_state_neutral:
+           if (IS_EUC_HI(c)) {
+               text->EUC_status = EUC_state_in_kanji;
+           }
+           else if (c == 0x8e) {
+               text->EUC_status = EUC_state_in_kana;
+           }
+           else if (c & 0x80) {
+               text->EUC_status = EUC_state_has_bad_code;
+               if (text->SJIS_status == SJIS_state_has_bad_code)
+                   text->detected_kcode = DET_MIXED;
+               else
+                   text->detected_kcode = DET_SJIS;
+           }
+           break;
+       case EUC_state_in_kanji:
+           if (IS_EUC_LOX(c)) {
+               text->EUC_status = EUC_state_neutral;
+           }
+           else {
+               text->EUC_status = EUC_state_has_bad_code;
+               if (text->SJIS_status == SJIS_state_has_bad_code)
+                   text->detected_kcode = DET_MIXED;
+               else
+                   text->detected_kcode = DET_SJIS;
+           }
+           break;
+       case EUC_state_in_kana:
+           if ((0xA1<=c)&&(c<=0xDF)) {
+               text->EUC_status = EUC_state_neutral;
+           }
+           else {
+               text->EUC_status = EUC_state_has_bad_code;
+               if (text->SJIS_status == SJIS_state_has_bad_code)
+                   text->detected_kcode = DET_MIXED;
+               else
+                   text->detected_kcode = DET_SJIS;
+           }
+           break;
+       }
+       if (save_d_kcode != text->detected_kcode) {
+           switch (text->detected_kcode) {
+           case DET_SJIS:
+               CTRACE((tfp, "TH_JP_AUTO_DETECT: This document's kcode seems 
SJIS.\n"));
+               break;
+           case DET_EUC:
+               CTRACE((tfp, "TH_JP_AUTO_DETECT: This document's kcode seems 
EUC.\n"));
+               break;
+           case DET_MIXED:
+               CTRACE((tfp, "TH_JP_AUTO_DETECT: This document's kcode seems 
mixed!\n"));
+               break;
+           }
+       }
+    }
+#endif /* USE_TH_JP_AUTO_DETECT */
     /*
      *  Make sure we don't hang on escape sequences.
      */
@@ -3567,6 +3687,8 @@
                 */
                if (ch == '@' || ch == 'B' || ch=='A') {
                    text->state = S_nonascii_text;
+                   if (ch == '@' || ch == 'B')
+                       text->kcode = JIS;
                    return;
                } else if (ch == '(') {
                    text->state = S_dollar_paren;
@@ -3605,6 +3727,7 @@
                     *  Can split here. - FM
                     */
                    text->permissible_split = text->last_line->size;
+                   text->kcode = JIS;
                    return;
                } else {
                    text->state = S_text;
@@ -3618,7 +3741,16 @@
                if (ch == CH_ESC) {  /* S/390 -- gil -- 1553 */
                    text->state = S_esc;
                    text->kanji_buf = '\0';
+                   if (HTCJK == JAPANESE) {
+                       text->kcode = NOKANJI;
+                   }
                    return;
+               } else if ((0 <= ch) && (ch < 32)) {
+                   text->state = S_text;
+                   text->kanji_buf = '\0';
+                   if (HTCJK == JAPANESE) {
+                       text->kcode = NOKANJI;
+                   }
                } else {
                    ch |= 0200;
                }
@@ -3631,10 +3763,12 @@
                if (ch == CH_ESC) {  /* S/390 -- gil -- 1570 */
                    text->state = S_esc;
                    text->kanji_buf = '\0';
+                   text->kcode = NOKANJI;
                    return;
                } else {
                    text->kanji_buf = '\216';
                    ch |= 0200;
+#if 0 /* This conversion is done after. --TH */
 #ifdef SH_EX
                    /**** Add Next Line by patakuti ****/
                    text->permissible_split = (int)text->last_line->size;
@@ -3645,6 +3779,7 @@
                        ch = low;
                }
 #endif
+#endif
        }
                break;
        } /* end switch */
@@ -3654,10 +3789,25 @@
                /*
                 *  JIS X0201 Kana in SJIS support. - by ASATAKU
                 */
+               if ((text->kcode != JIS) && 
+#ifdef KANJI_CODE_OVERRIDE
+                   ((last_kcode == SJIS) ||
+                    ((last_kcode == NOKANJI) &&
+#else
+                   ((
+#endif
+                     ((text->kcode == SJIS) || 
+#ifdef USE_TH_JP_AUTO_DETECT
+                      ((text->detected_kcode == DET_SJIS) && 
(text->specified_kcode == NOKANJI)) ||
+#endif
+                      ((text->kcode == NOKANJI) && (text->specified_kcode == 
SJIS))))) &&
+#if 0
                if ((text->kcode == SJIS) &&
+#endif
                    ((unsigned char)ch >= 0xA1) &&
                    ((unsigned char)ch <= 0xDF))
                {
+#ifdef CONV_JISX0201KANA_TO_JISX0208KANA
                    unsigned char c = (unsigned char)ch;
                    unsigned char kb = (unsigned char)text->kanji_buf;
                    JISx0201TO0208_SJIS(c,
@@ -3665,6 +3815,7 @@
                                        (unsigned char *)&c);
                    ch = (char)c;
                    text->kanji_buf = kb;
+#endif
                    /* 1998/01/19 (Mon) 09:06:15 */
                    text->permissible_split = (int)text->last_line->size;
                } else {
@@ -3677,7 +3828,7 @@
                }
            }
        } else {
-           goto check_IgnoreExcess;
+           goto check_WrapSource;
        }
     } else if (ch == CH_ESC) {  /* S/390 -- gil -- 1587 */
        return;
@@ -3952,20 +4103,33 @@
        }
        return;
     } /* if tab */
-    else if ( (text->source || dont_wrap_pre) && text == HTMainText) {
+
+check_WrapSource:
+    if ( (text->source || dont_wrap_pre) && text == HTMainText) {
        /*
         * If we're displaying document source, wrap long lines to keep all of
         * the source visible.
         */
        int target = (int)(line->offset + line->size) - ctrl_chars_on_this_line;
        int target_cu = target + utfxtra_on_this_line;
-       if (target >= (LYcols-1) - style->rightIndent ||
+       if (target >= (LYcols-1) - style->rightIndent - 
+           (((HTCJK != NOCJK) && text->kanji_buf) ? 1 : 0) ||
            (text->T.output_utf8 &&
             target_cu + UTF_XLEN(ch) >= (LYcols_cu-1))
            ) {
+           int saved_kanji_buf;
+           int saved_state;
+
            new_line(text);
            line = text->last_line;
+
+           saved_kanji_buf = text->kanji_buf;
+           saved_state = text->state;
+           text->kanji_buf = '\0';
+           text->state = S_text;
            HText_appendCharacter (text, LY_SOFT_NEWLINE);
+           text->kanji_buf = saved_kanji_buf;
+           text->state = saved_state;
        }
     }
 
@@ -3998,6 +4162,7 @@
      */
     if (((indent + (int)line->offset + (int)line->size) +
         (int)style->rightIndent - ctrl_chars_on_this_line +
+        (((HTCJK != NOCJK) && text->kanji_buf) ? 1 : 0) +
         ((line->size > 0) &&
          (int)(line->data[line->size-1] ==
                                LY_SOFT_HYPHEN ?
@@ -4078,12 +4243,40 @@
 
        line = text->last_line; /* May have changed */
 
-#ifdef CJK_EX  /* 1997/11/14 (Fri) 09:10:03 */
        if (HTCJK != NOCJK && text->kanji_buf) {
            hi = (unsigned char)text->kanji_buf;
            lo = (unsigned char)ch;
 
            if (HTCJK == JAPANESE) {
+               if (text->kcode != JIS) {
+                   if (IS_SJIS_2BYTE(hi, lo)) {
+                       if (IS_EUC(hi, lo)) {
+#ifdef KANJI_CODE_OVERRIDE
+                           if (last_kcode != NOKANJI)
+                               text->kcode = last_kcode;
+                           else
+#endif
+                               if (text->specified_kcode != NOKANJI)
+                                   text->kcode = text->specified_kcode;
+#ifdef USE_TH_JP_AUTO_DETECT
+                               else if (text->detected_kcode == DET_EUC)
+                                   text->kcode = EUC;
+                               else if (text->detected_kcode == DET_SJIS)
+                                   text->kcode = SJIS;
+#endif
+                               else if (IS_EUC_X0201KANA(hi, lo) && 
(text->kcode != EUC))
+                                   text->kcode = SJIS;
+                       }
+                       else
+                           text->kcode = SJIS;
+                   }
+                   else if (IS_EUC(hi, lo))
+                       text->kcode = EUC;
+                   else
+                       text->kcode = NOKANJI;
+               }
+
+#if 0 /* This judgement routine is replaced by above one. -- TH */
                if (text->kcode == NOKANJI)
                {
                    if (IS_SJIS(hi, lo, text->in_sjis) && IS_EUC(hi, lo)) {
@@ -4094,6 +4287,7 @@
                        text->kcode = EUC;
                    }
                }
+#endif
 
                switch (kanji_code) {
                case EUC:
@@ -4101,37 +4295,39 @@
                        SJIS_TO_EUC1(hi, lo, tmp);
                        line->data[line->size++] = tmp[0];
                        line->data[line->size++] = tmp[1];
-                   } else if (text->kcode == EUC) {
+                   } else if (IS_EUC(hi, lo)) {
+#ifdef CONV_JISX0201KANA_TO_JISX0208KANA
                        JISx0201TO0208_EUC(hi, lo, &hi, &lo);
+#endif
                        line->data[line->size++] = hi;
                        line->data[line->size++] = lo;
+                   } else {
+                       CTRACE((tfp, "This character (%X:%X) doesn't seem 
Japanese\n", hi, lo));
+                       line->data[line->size++] = '=';
+                       line->data[line->size++] = '=';
                    }
                    break;
 
                case SJIS:
-                   if (last_kcode != SJIS && text->kcode == EUC)
+                   if ((text->kcode == EUC) || (text->kcode == JIS))
                    {
-                       EUC_TO_SJIS1(hi, lo, tmp);
-                       line->data[line->size++] = tmp[0];
-                       line->data[line->size++] = tmp[1];
-                   } else {
-                       /* text->kcode == (SJIS or NOKANJI) */
-#ifdef CJK_EX  /* 1998/01/20 (Tue) 16:46:34 */
-                       if (last_kcode == EUC) {
-                           if (lo == 0) {      /* BAD EUC code */
-                               hi = '=';
-                               lo = '=';
-                           } else if (hi == 0x8e) {
-                               text->kcode = NOKANJI;
-                               JISx0201TO0208_EUC(hi, lo, &hi, &lo);
-                               EUC_TO_SJIS1(hi, lo, tmp);
-                               hi = tmp[0];
-                               lo = tmp[1];
-                           }
-                       }
+#ifndef CONV_JISX0201KANA_TO_JISX0208KANA
+                       if (IS_EUC_X0201KANA(hi, lo))
+                           line->data[line->size++] = lo;
+                       else
 #endif
+                       {
+                           EUC_TO_SJIS1(hi, lo, tmp);
+                           line->data[line->size++] = tmp[0];
+                           line->data[line->size++] = tmp[1];
+                       }
+                   } else if (IS_SJIS_2BYTE(hi, lo)) {
                        line->data[line->size++] = hi;
                        line->data[line->size++] = lo;
+                   } else {
+                       line->data[line->size++] = '=';
+                       line->data[line->size++] = '=';
+                       CTRACE((tfp, "This character (%X:%X) doesn't seem 
Japanese\n", hi, lo));
                    }
                    break;
 
@@ -4144,7 +4340,7 @@
            }
            text->kanji_buf = 0;
        }
-#else
+#if 0
        if (HTCJK != NOCJK && text->kanji_buf) {
            hi = (unsigned char)text->kanji_buf, lo = (unsigned char)ch;
            if (HTCJK == JAPANESE && text->kcode == NOKANJI) {
@@ -4163,7 +4359,9 @@
                line->data[line->size++] = tmp[1];
            } else if (HTCJK == JAPANESE &&
                       (kanji_code == EUC) && (text->kcode == EUC)) {
+#ifdef CONV_JISX0201KANA_TO_JISX0208KANA
                JISx0201TO0208_EUC(hi, lo, &hi, &lo);
+#endif
                line->data[line->size++] = hi;
                line->data[line->size++] = lo;
            } else if (HTCJK == JAPANESE &&
@@ -4178,6 +4376,13 @@
            text->kanji_buf = 0;
        }
 #endif
+#ifndef CONV_JISX0201KANA_TO_JISX0208KANA
+       else if ((HTCJK == JAPANESE) && IS_SJIS_X0201KANA((unsigned char)(ch)) 
&& 
+                (kanji_code == EUC)) {
+           line->data[line->size++] = 0x8e;
+           line->data[line->size++] = ch;
+       }
+#endif
        else if (HTCJK != NOCJK) {
            line->data[line->size++] = (char) (
                                       (kanji_code != NOKANJI) ?
@@ -11172,6 +11377,8 @@
        CONST char *,   charset,
        LYUCcharset *,  p_in)
 {
+    BOOL explicit;
+
     if (!text)
        return;
 
@@ -11181,6 +11388,7 @@
     if (!charset && !p_in) {
        return;
     }
+    explicit = charset ? TRUE : FALSE;
     /*
     **  If no explicit charset string, use the implied one. - kw
     */
@@ -11209,8 +11417,10 @@
               !strcmp(charset, "x-euc") ||     /* 1997/11/28 (Fri) 18:11:24 */
               !strcmp(charset, "euc-jp") ||
               !strncmp(charset, "x-euc-", 6) ||
+#if 0 /* iso-2022-jp* shouldn't be treated as euc-jp */
               !strcmp(charset, "iso-2022-jp") ||
               !strcmp(charset, "iso-2022-jp-2") ||
+#endif
               !strcmp(charset, "euc-kr") ||
               !strcmp(charset, "iso-2022-kr") ||
               !strcmp(charset, "big5") ||
@@ -11225,7 +11435,7 @@
        **  If we get to here, it's not CJK, so disable that if
        **  it is enabled.  But only if we are quite sure. - FM & kw
        */
-#ifdef CJK_EX
+#ifdef KANJI_CODE_OVERRIDE
        last_kcode = text->kcode = NOKANJI;
 #else
        text->kcode = NOKANJI;
@@ -11235,6 +11445,16 @@
                HTCJK = NOCJK;
        }
     }
+    if (explicit)
+       text->specified_kcode = text->kcode;
+    else {
+       if (UCAssume_MIMEcharset) {
+           if (!strcmp(UCAssume_MIMEcharset, "euc-jp"))
+               text->kcode = text->specified_kcode = EUC;
+           else if (!strcmp(UCAssume_MIMEcharset, "shift_jis"))
+               text->kcode = text->specified_kcode = SJIS;
+       }
+    }
 
     return;
 }
@@ -13650,7 +13870,6 @@
 }
 #endif
 
-#ifdef CJK_EX
 PUBLIC HTkcode HText_getKcode ARGS1(
        HText *,        text)
 {
@@ -13663,7 +13882,19 @@
 {
     text->kcode = kcode;
 }
-#endif
+
+PUBLIC HTkcode HText_getSpecifiedKcode ARGS1(
+       HText *,        text)
+{
+    return text->specified_kcode;
+}
+
+PUBLIC void HText_updateSpecifiedKcode ARGS2(
+       HText *,        text,
+       HTkcode,        kcode)
+{
+    text->specified_kcode = kcode;
+}
 
 PUBLIC int HTMainText_Get_UCLYhndl NOARGS
 {
diff -ru orig/lynx2-8-3/src/GridText.h lynx2-8-3/src/GridText.h
--- orig/lynx2-8-3/src/GridText.h       Fri Jan  7 12:02:22 2000
+++ lynx2-8-3/src/GridText.h    Sat Feb 12 10:05:06 2000
@@ -310,14 +310,15 @@
 
 extern int HTMainText_Get_UCLYhndl NOPARAMS;
 
-#ifdef CJK_EX
-
 #include <HTCJK.h>
+
+#ifdef KANJI_CODE_OVERRIDE
 extern HTkcode last_kcode;
+#endif
 
 extern HTkcode HText_getKcode PARAMS((HText * text));
 extern void HText_updateKcode PARAMS((HText * text, HTkcode kcode));
-
-#endif
+extern HTkcode HText_getSpecifiedKcode PARAMS((HText * text));
+extern void HText_updateSpecifiedKcode PARAMS((HText * text, HTkcode kcode));
 
 #endif /* LYGRIDTEXT_H */
diff -ru orig/lynx2-8-3/src/HTML.c lynx2-8-3/src/HTML.c
--- orig/lynx2-8-3/src/HTML.c   Fri Jan  7 12:02:22 2000
+++ lynx2-8-3/src/HTML.c        Sat Feb 12 10:04:28 2000
@@ -243,7 +243,7 @@
 */
 PUBLIC void HTML_put_character ARGS2(HTStructured *, me, char, c)
 {
-#ifdef CJK_EX
+#ifdef KANJI_CODE_OVERRIDE
     static unsigned char save_ch1 = 0;
     static unsigned char save_ch2 = 0;
 #endif
@@ -427,7 +427,7 @@
            } else {
                me->inP = TRUE;
                me->inLABEL = FALSE;
-#ifdef CJK_EX
+#if 0 /* Should this check be done in HText_appendCharacter? */
                if (last_kcode == EUC) {
                    if (save_ch1 && !save_ch2) {
                        if ((unsigned char)c & 0x80) {
@@ -445,9 +445,8 @@
                } else {
                    HText_appendCharacter(me->text, c);
                }
-#else
-               HText_appendCharacter(me->text, c);
 #endif
+               HText_appendCharacter(me->text, c);
                me->in_word = YES;
            }
        }
@@ -4964,9 +4963,8 @@
            BOOL HaveSRClink = FALSE;
            char* ImageSrc = NULL;
            BOOL IsSubmitOrReset = FALSE;
-#ifdef CJK_EX
            HTkcode kcode = 0;
-#endif
+           HTkcode specified_kcode = 0;
            /* init */
            I.align=NULL; I.accept=NULL; I.checked=NO; I.class=NULL;
            I.disabled=NO; I.error=NULL; I.height= NULL; I.id=NULL;
@@ -5397,12 +5395,12 @@
                for (; chars > 0; chars--)
                    HTML_put_character(me, '_');
            } else {
-#ifdef CJK_EX
-               if (HTCJK != NOCJK) {
+               if (HTCJK == JAPANESE) {
                    kcode = HText_getKcode(me->text);
                    HText_updateKcode(me->text, kanji_code);
+                   specified_kcode = HText_getSpecifiedKcode(me->text);
+                   HText_updateSpecifiedKcode(me->text, kanji_code);
                }
-#endif
                if (me->sp[0].tag_number == HTML_PRE ||
                    !me->sp->style->freeFormat) {
                    /*
@@ -5442,10 +5440,10 @@
                    while (i < chars)
                        HTML_put_character(me, HT_NON_BREAK_SPACE);
                }
-#ifdef CJK_EX
-               if (HTCJK != NOCJK)
+               if (HTCJK == JAPANESE) {
                    HText_updateKcode(me->text, kcode);
-#endif
+                   HText_updateSpecifiedKcode(me->text, specified_kcode);
+               }
            }
            HText_setIgnoreExcess(me->text, FALSE);
            FREE(ImageSrc);
@@ -7551,8 +7549,21 @@
                for (; ptr && *ptr != '\0'; ptr++) {
                    if (*ptr == ' ')
                        HText_appendCharacter(me->text,HT_NON_BREAK_SPACE);
-                   else
+                   else {
+                       HTkcode kcode = 0;
+                       HTkcode specified_kcode = 0;
+                       if (HTCJK == JAPANESE) {
+                           kcode = HText_getKcode(me->text);
+                           HText_updateKcode(me->text, kanji_code);
+                           specified_kcode = HText_getSpecifiedKcode(me->text);
+                           HText_updateSpecifiedKcode(me->text, kanji_code);
+                       }
                        HText_appendCharacter(me->text,*ptr);
+                       if (HTCJK == JAPANESE) {
+                           HText_updateKcode(me->text, kcode);
+                           HText_updateSpecifiedKcode(me->text, 
specified_kcode);
+                       }
+                   }
                }
                /*
                 *  Add end option character.
@@ -8810,19 +8821,19 @@
 #ifdef SH_EX   /* 1998/04/02 (Thu) 16:02:00 */
 
     /* for proxy server 1998/12/19 (Sat) 11:53:30 */
-    if (stricmp(newtitle + 1, "internal-gopher-menu") == 0) {
+    if (AS_casecomp(newtitle + 1, "internal-gopher-menu") == 0) {
        StrAllocCopy(newtitle, "+");
-    } else if (stricmp(newtitle + 1, "internal-gopher-unknown") == 0) {
+    } else if (AS_casecomp(newtitle + 1, "internal-gopher-unknown") == 0) {
        StrAllocCopy(newtitle, " ");
     } else {
        /* normal title */
        ptr = strrchr(newtitle, '.');
        if (ptr) {
-         if (stricmp(ptr, ".gif") == 0)
+         if (AS_casecomp(ptr, ".gif") == 0)
            *ptr = '\0';
-         else if (stricmp(ptr, ".jpg") == 0)
+         else if (AS_casecomp(ptr, ".jpg") == 0)
            *ptr = '\0';
-         else if (stricmp(ptr, ".jpeg") == 0)
+         else if (AS_casecomp(ptr, ".jpeg") == 0)
            *ptr = '\0';
        }
        StrAllocCat(newtitle, "]");
diff -ru orig/lynx2-8-3/src/LYCharUtils.c lynx2-8-3/src/LYCharUtils.c
--- orig/lynx2-8-3/src/LYCharUtils.c    Wed Dec  1 12:33:02 1999
+++ lynx2-8-3/src/LYCharUtils.c Sat Feb 12 10:04:38 2000
@@ -1658,7 +1658,7 @@
     enum _parsing_what
        { P_text, P_utf8, P_hex, P_decimal, P_named
        } what = P_text;
-#ifdef CJK_EX  /* 1997/12/12 (Fri) 18:08:48 */
+#ifdef KANJI_CODE_OVERRIDE
     static unsigned char sjis_1st = '\0';
     unsigned char sjis_str[3];
 #endif
@@ -1763,13 +1763,14 @@
        switch(state) {
        case S_text:
            code = (unsigned char)(*p);
-#ifdef CJK_EX  /* 1997/12/13 (Sat) 14:41:53 */
+#ifdef KANJI_CODE_OVERRIDE
            if (HTCJK == JAPANESE && last_kcode == SJIS) {
                if (sjis_1st == '\0' && (IS_SJIS_HI1(code)||IS_SJIS_HI2(code))){
                    sjis_1st = (unsigned char)code;
                } else if (sjis_1st && IS_SJIS_LO(code)) {
                    sjis_1st = '\0';
                } else {
+#ifdef CONV_JISX0201KANA_TO_JISX0208KANA
                    if (0xA1 <= code && code <= 0xDF) {
                        sjis_str[2] = '\0';
                        JISx0201TO0208_SJIS((unsigned char)code,
@@ -1778,6 +1779,7 @@
                        p++;
                        continue;
                    }
+#endif
                }
            }
 #endif
diff -ru orig/lynx2-8-3/src/LYHistory.c lynx2-8-3/src/LYHistory.c
--- orig/lynx2-8-3/src/LYHistory.c      Wed Dec 15 20:03:18 1999
+++ lynx2-8-3/src/LYHistory.c   Sat Feb 12 09:55:50 2000
@@ -26,6 +26,7 @@
 
 #include <LYexit.h>
 #include <LYLeaks.h>
+#include <HTCJK.h>
 
 PUBLIC HTList * Visited_Links = NULL;  /* List of safe popped docs. */
 PUBLIC int Visited_Links_As = VISITED_LINKS_AS_TREE;
@@ -37,6 +38,8 @@
 PRIVATE VisitedLink *First_tree;
 PRIVATE VisitedLink *Last_by_first;
 
+extern HTCJKlang HTCJK;
+
 #ifdef LY_FIND_LEAKS
 /*
  *  Utility for freeing the list of visited links. - FM
@@ -75,6 +78,7 @@
     VisitedLink *new;
     HTList *cur;
     char *title = (doc->title ? doc->title : NO_TITLE);
+    char *tmp_buffer = NULL;
 
     if (!(doc->address && *doc->address)) {
        PrevVisitedLink = NULL;
@@ -156,7 +160,25 @@
     if ((new = (VisitedLink *)calloc(1, sizeof(*new))) == NULL)
        outofmem(__FILE__, "LYAddVisitedLink");
     StrAllocCopy(new->address, doc->address);
-    StrAllocCopy(new->title, title);
+    if (HTCJK == JAPANESE) {
+       if ((tmp_buffer = (char *) malloc (strlen(title))) == 0)
+           outofmem(__FILE__, "LYAddVisitedLink");
+       switch(kanji_code) {
+       case EUC:
+           TO_EUC((CONST unsigned char *) title, (unsigned char *) tmp_buffer);
+           break;
+       case SJIS:
+           TO_SJIS((CONST unsigned char *) title, (unsigned char *) 
tmp_buffer);
+           break;
+       default:
+           TO_JIS((CONST unsigned char *) title, (unsigned char *) tmp_buffer);
+           break;
+       }
+       StrAllocCopy(new->title, tmp_buffer);
+       FREE(tmp_buffer);
+    } else {
+       StrAllocCopy(new->title, title);
+    }
 
     /* First-visited chain */
     HTList_appendObject(Visited_Links, new);   /* At end */
@@ -259,6 +281,8 @@
        document *,     doc,
        BOOLEAN,        force_push)
 {
+    char *tmp_buffer = NULL;
+
     /*
      * Don't push NULL file names.
      */
@@ -309,7 +333,25 @@
        history[nhist].link = doc->link;
        history[nhist].line = doc->line;
        history[nhist].title = NULL;
-       StrAllocCopy(history[nhist].title, doc->title);
+       if (HTCJK == JAPANESE) {
+           if ((tmp_buffer = (char *) malloc (strlen(doc->title))) == 0)
+               outofmem(__FILE__, "LYpush");
+           switch(kanji_code) {
+           case EUC:
+               TO_EUC((CONST unsigned char *) doc->title, (unsigned char *) 
tmp_buffer);
+               break;
+           case SJIS:
+               TO_SJIS((CONST unsigned char *) doc->title, (unsigned char *) 
tmp_buffer);
+               break;
+           default:
+               TO_JIS((CONST unsigned char *) doc->title, (unsigned char *) 
tmp_buffer);
+               break;
+           }
+           StrAllocCopy(history[nhist].title, tmp_buffer);
+           FREE(tmp_buffer);
+       } else {
+           StrAllocCopy(history[nhist].title, doc->title);
+       }
        history[nhist].address = NULL;
        StrAllocCopy(history[nhist].address, doc->address);
        history[nhist].post_data = NULL;
diff -ru orig/lynx2-8-3/src/LYKeymap.c lynx2-8-3/src/LYKeymap.c
--- orig/lynx2-8-3/src/LYKeymap.c       Wed Dec  1 12:33:02 1999
+++ lynx2-8-3/src/LYKeymap.c    Sat Feb 12 10:04:46 2000
@@ -69,16 +69,20 @@
 LYK_HISTORY,    LYK_FASTFORW_LINK,  LYK_ACTIVATE,  LYK_COOKIE_JAR,
 /* bs */            /* ht */        /* nl */       /* ^K */
 
-#ifdef SH_EX   /* 1998/10/02 (Fri) 08:48:44 */
+#ifdef KANJI_CODE_OVERRIDE
 LYK_CHG_KCODE,    LYK_ACTIVATE,     LYK_DOWN_TWO,      0,
 /* ^L */            /* cr */        /* ^N */       /* ^O */
 
-LYK_UP_TWO,       LYK_CHG_CENTER,   LYK_RELOAD,    LYK_TO_CLIPBOARD,
-/* ^P */            /* XON */       /* ^R */       /* ^S */
 #else
 LYK_REFRESH,      LYK_ACTIVATE,     LYK_DOWN_TWO,      0,
 /* ^L */            /* cr */        /* ^N */       /* ^O */
+#endif
+
+#ifdef SH_EX   /* 1998/10/02 (Fri) 08:48:44 */
+LYK_UP_TWO,       LYK_CHG_CENTER,   LYK_RELOAD,    LYK_TO_CLIPBOARD,
+/* ^P */            /* XON */       /* ^R */       /* ^S */
 
+#else
 LYK_UP_TWO,             0,          LYK_RELOAD,        0,
 /* ^P */            /* XON */       /* ^R */       /* XOFF */
 #endif
diff -ru orig/lynx2-8-3/src/LYKeymap.h lynx2-8-3/src/LYKeymap.h
--- orig/lynx2-8-3/src/LYKeymap.h       Wed Dec  1 12:33:02 1999
+++ lynx2-8-3/src/LYKeymap.h    Sat Feb 12 10:05:10 2000
@@ -228,9 +228,10 @@
 #ifdef SH_EX
   , LYK_CHG_CENTER
   , LYK_TO_CLIPBOARD
-  , LYK_CHG_KCODE
 #endif /* SH_EX */
-
+#ifdef KANJI_CODE_OVERRIDE
+  , LYK_CHG_KCODE
+#endif
 } LYKeymapCode;
 
 
diff -ru orig/lynx2-8-3/src/LYMail.c lynx2-8-3/src/LYMail.c
--- orig/lynx2-8-3/src/LYMail.c Wed Sep 29 20:40:38 1999
+++ lynx2-8-3/src/LYMail.c      Sat Jan  8 20:45:20 2000
@@ -2048,7 +2048,7 @@
     while ((n = fread(buf, 1, sizeof(buf), fd)) != 0) {
        fwrite(buf, 1, n, fp);
     }
-#if defined(DOSPATH) || defined(SH_EX)
+#if defined(DOSPATH) || (defined(SH_EX) && defined(WIN_EX))
 #ifdef SH_EX   /* 1998/05/04 (Mon) 22:40:35 */
     if (mail_is_blat) {
        StrAllocCopy(command,
diff -ru orig/lynx2-8-3/src/LYMainLoop.c lynx2-8-3/src/LYMainLoop.c
--- orig/lynx2-8-3/src/LYMainLoop.c     Fri Jan  7 12:02:22 2000
+++ lynx2-8-3/src/LYMainLoop.c  Sat Feb 12 10:04:54 2000
@@ -39,11 +39,16 @@
 #include <LYMainLoop.h>
 #include <LYPrettySrc.h>
 
-#if defined(CJK_EX)    /* 1999/05/25 (Tue) 11:10:45 */
+#ifdef KANJI_CODE_OVERRIDE
 #include <HTCJK.h>
 extern HTCJKlang HTCJK;
+#endif
+
+#if defined(CJK_EX)    /* 1999/05/25 (Tue) 11:10:45 */
 extern char *string_short(char *str, int cut_pos);     /* LYExtern.c */
+#endif
 
+#ifdef KANJI_CODE_OVERRIDE
 PUBLIC char *str_kcode(HTkcode code)
 {
     char *p;
@@ -90,17 +95,21 @@
 
     return buff;
 }
+#endif
 
+#ifdef CJK_EX
 #ifdef WIN_EX
 
 PRIVATE char *str_sjis(char *to, char *from)
 {
     if (!LYRawMode) {
        strcpy(to, from);
+#ifdef KANJI_CODE_OVERRIDE
     } else if (last_kcode == EUC) {
        EUC_TO_SJIS(from, to);
     } else if (last_kcode == SJIS) {
        strcpy(to, from);
+#endif
     } else {
        TO_SJIS(from, to);
     }
@@ -3173,7 +3182,7 @@
                }
 
        } else {
-#ifdef CJK_EX  /* 1997/12/13 (Sat) 15:20:18 */
+#ifdef KANJI_CODE_OVERRIDE
            if (HTCJK == JAPANESE) {
                last_kcode = NOKANJI;   /* AUTO */
            }
@@ -4718,7 +4727,7 @@
                *refresh_screen = TRUE;
            return;
        }
-#if defined(CJK_EX)    /* 1997/12/13 (Sat) 15:20:18 */
+#ifdef KANJI_CODE_OVERRIDE
        if (HTCJK == JAPANESE) {
            last_kcode = NOKANJI;       /* AUTO */
        }
@@ -6796,7 +6805,7 @@
            break;
 #endif
 
-#if defined(CJK_EX) && defined(SH_EX)  /* 1999/02/25 (Thu) 15:29:05 */
+#ifdef KANJI_CODE_OVERRIDE
        case LYK_CHG_KCODE:     /* ^L */
            if (LYRawMode && (HTCJK == JAPANESE)) {
                switch(last_kcode) {
diff -ru orig/lynx2-8-3/src/LYOptions.c lynx2-8-3/src/LYOptions.c
--- orig/lynx2-8-3/src/LYOptions.c      Fri Jan  7 12:02:22 2000
+++ lynx2-8-3/src/LYOptions.c   Sat Jan 22 21:48:40 2000
@@ -24,6 +24,8 @@
 
 #include <LYLeaks.h>
 
+extern HTCJKlang HTCJK;
+
 BOOLEAN term_options;
 
 PRIVATE void terminate_options PARAMS((int sig));
@@ -922,7 +924,8 @@
                            StrAllocCopy(UCAssume_MIMEcharset,
                                         
LYCharSet_UC[UCLYhndl_for_unspec].MIMEname);
                        }
-                       LYRawMode = (BOOL) (UCLYhndl_for_unspec == 
current_char_set);
+                       if (HTCJK != JAPANESE)
+                           LYRawMode = (BOOL) (UCLYhndl_for_unspec == 
current_char_set);
                        HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
                        HTMLSetCharacterHandling(current_char_set);
                        CurrentAssumeCharSet = UCLYhndl_for_unspec;
@@ -4048,7 +4051,7 @@
                LYUseDefaultRawMode = TRUE;
                HTMLUseCharacterSet(current_char_set);
            }
-       if (assume_char_set_changed) {
+       if (assume_char_set_changed && HTCJK != JAPANESE) {
                LYRawMode = (BOOL) (UCLYhndl_for_unspec == current_char_set);
            }
        if (raw_mode_old != LYRawMode || assume_char_set_changed) {
diff -ru orig/lynx2-8-3/src/LYUtils.c lynx2-8-3/src/LYUtils.c
--- orig/lynx2-8-3/src/LYUtils.c        Fri Jan  7 12:02:22 2000
+++ lynx2-8-3/src/LYUtils.c     Sat Feb 12 10:05:00 2000
@@ -1984,7 +1984,7 @@
        if (kanji_code == EUC) {
            TO_EUC((CONST unsigned char *)text_buff, temp);
        } else if (kanji_code == SJIS) {
-#ifdef CJK_EX
+#ifdef KANJI_CODE_OVERRIDE
            if (!LYRawMode || last_kcode == SJIS)
                strcpy(temp, text_buff);
            else
diff -ru orig/lynx2-8-3/src/UCdomap.c lynx2-8-3/src/UCdomap.c
--- orig/lynx2-8-3/src/UCdomap.c        Thu Nov  4 11:41:38 1999
+++ lynx2-8-3/src/UCdomap.c     Sat Jan  8 20:45:20 2000
@@ -1578,13 +1578,13 @@
     }
 #endif
 #if !NO_CHARSET_euc_jp
-    if (!strncasecomp(value, "iso-2022-jp", 11) ||
-       !strcasecomp(value, "x-euc-jp")) {
+    if (!strcasecomp(value, "x-euc-jp")) {
        return UCGetLYhndl_byMIME("euc-jp");
     }
 #endif
 #if !NO_CHARSET_shift_jis
-    if (!strcasecomp(value, "x-shift-jis")) {
+    if ((!strcasecomp(value, "x-shift-jis")) ||
+       (!strcasecomp(value, "x-sjis"))) {
        return UCGetLYhndl_byMIME("shift_jis");
     }
 #endif

reply via email to

[Prev in Thread] Current Thread [Next in Thread]