lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev changes for Japanese


From: Hataguchi Takeshi
Subject: Re: lynx-dev changes for Japanese
Date: Sat, 12 Feb 2000 22:52:57 +0900 (JST)

On Fri, 11 Feb 2000, Hataguchi Takeshi wrote:

> 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.

There are some bugs in it. Please apply this patch after
applying my last patch.
--
Takeshi Hataguchi
E-mail: address@hidden

diff -ru orig/lynx2-8-3/src/GridText.c lynx2-8-3/src/GridText.c
--- orig/lynx2-8-3/src/GridText.c       Sat Feb 12 10:17:12 2000
+++ lynx2-8-3/src/GridText.c    Sat Feb 12 22:34:06 2000
@@ -11408,12 +11408,18 @@
     **  so check the charset value and set the text->kcode element
     **  appropriately. - FM
     */
-    if (!strcmp(charset, "shift_jis") ||
+    /*  If charset isn't specified explicitely nor assumed, 
+     *  p_in->MIMEname would be set as display charset.
+     *  So text->kcode sholud be set as SJIS or EUC here only if charset
+     *  is specified explicitely, otherwise text->kcode would cause
+     *  mishandling Japanese strings. -- TH
+     */
+    if (explicit && (!strcmp(charset, "shift_jis") ||
        !strcmp(charset, "x-sjis") ||           /* 1997/11/28 (Fri) 18:11:33 */
-       !strcmp(charset, "x-shift-jis"))
+       !strcmp(charset, "x-shift-jis")))
     {
        text->kcode = SJIS;
-    } else if ((p_in && (p_in->enc == UCT_ENC_CJK)) ||
+    } else if (explicit && ((p_in && (p_in->enc == UCT_ENC_CJK)) ||
               !strcmp(charset, "x-euc") ||     /* 1997/11/28 (Fri) 18:11:24 */
               !strcmp(charset, "euc-jp") ||
               !strncmp(charset, "x-euc-", 6) ||
@@ -11428,7 +11434,7 @@
               !strcmp(charset, "euc-cn") ||
               !strcmp(charset, "gb2312") ||
               !strncmp(charset, "cn-gb", 5) ||
-              !strcmp(charset, "iso-2022-cn")) {
+              !strcmp(charset, "iso-2022-cn"))) {
        text->kcode = EUC;
     } else {
        /*
diff -ru orig/lynx2-8-3/src/LYHistory.c lynx2-8-3/src/LYHistory.c
--- orig/lynx2-8-3/src/LYHistory.c      Sat Feb 12 10:17:12 2000
+++ lynx2-8-3/src/LYHistory.c   Sat Feb 12 22:16:04 2000
@@ -161,7 +161,7 @@
        outofmem(__FILE__, "LYAddVisitedLink");
     StrAllocCopy(new->address, doc->address);
     if (HTCJK == JAPANESE) {
-       if ((tmp_buffer = (char *) malloc (strlen(title))) == 0)
+       if ((tmp_buffer = (char *) malloc (strlen(title)+1)) == 0)
            outofmem(__FILE__, "LYAddVisitedLink");
        switch(kanji_code) {
        case EUC:
@@ -171,7 +171,8 @@
            TO_SJIS((CONST unsigned char *) title, (unsigned char *) 
tmp_buffer);
            break;
        default:
-           TO_JIS((CONST unsigned char *) title, (unsigned char *) tmp_buffer);
+           CTRACE((tfp, "\nLYADDVisitedLink: kanji_code is an unexpected 
value."));
+           strcpy(tmp_buffer, title);
            break;
        }
        StrAllocCopy(new->title, tmp_buffer);
@@ -334,7 +335,7 @@
        history[nhist].line = doc->line;
        history[nhist].title = NULL;
        if (HTCJK == JAPANESE) {
-           if ((tmp_buffer = (char *) malloc (strlen(doc->title))) == 0)
+           if ((tmp_buffer = (char *) malloc (strlen(doc->title)+1)) == 0)
                outofmem(__FILE__, "LYpush");
            switch(kanji_code) {
            case EUC:
@@ -344,7 +345,8 @@
                TO_SJIS((CONST unsigned char *) doc->title, (unsigned char *) 
tmp_buffer);
                break;
            default:
-               TO_JIS((CONST unsigned char *) doc->title, (unsigned char *) 
tmp_buffer);
+               CTRACE((tfp, "\nLYpush: kanji_code is an unexpected value."));
+               strcpy(tmp_buffer, doc->title);
                break;
            }
            StrAllocCopy(history[nhist].title, tmp_buffer);

reply via email to

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