On Sat, 11 Mar 2000, Hataguchi Takeshi wrote:
> It seems that Lynx may mishandle Japanese strings in the source
> mode and the usemap page.
>
> Unfortunately I don't have enough time to improve it nor explain
> about it detail now. I believe that I can do it next weekend.
I wrote a patch for 2.8.3dev22.
o modify LYUCPushAssumed to push original assume_charset insted of
anchor_UCI->MIMEname when HTCJK is JAPANESE.
If this modification isn't done, Japanese strings may be mishundled
when charset isn't specified nor assumed as Japanese charset.
In the other hand, if this modification IS done, the specified charset
is ignored when HTCJK is JAPANESE.
# I think it's long way to improve this completely. It rarely
# causes small problem in source view mode for Japanese document.
# I think it can be ignored.
o improve handling Japanese in List Page, LYNXIMGMAP Page and
ShowInfo Page.
--
Takeshi Hataguchi
E-mail: [EMAIL PROTECTED]
%%% Created Mon Mar 20 09:59:37 JST 2000 by target lynx.patch. %%%
diff -bru orig/lynx2-8-3/WWW/Library/Implementation/HTAccess.c
lynx2-8-3/WWW/Library/Implementation/HTAccess.c
--- orig/lynx2-8-3/WWW/Library/Implementation/HTAccess.c Tue Feb 15 13:07:38
2000
+++ lynx2-8-3/WWW/Library/Implementation/HTAccess.c Mon Mar 20 09:12:42 2000
@@ -620,6 +620,9 @@
if (anchor_UCI && anchor_UCI->MIMEname) {
pushed_assume_MIMEname = UCAssume_MIMEcharset;
UCAssume_MIMEcharset = NULL;
+ if (HTCJK == JAPANESE)
+ StrAllocCopy(UCAssume_MIMEcharset, pushed_assume_MIMEname);
+ else
StrAllocCopy(UCAssume_MIMEcharset, anchor_UCI->MIMEname);
pushed_assume_LYhndl = anchor_LYhndl;
/* some diagnostics */
diff -bru orig/lynx2-8-3/src/LYList.c lynx2-8-3/src/LYList.c
--- orig/lynx2-8-3/src/LYList.c Wed Dec 15 20:03:18 1999
+++ lynx2-8-3/src/LYList.c Mon Mar 20 09:12:42 2000
@@ -13,6 +13,7 @@
#include <LYClean.h>
#include <LYGlobalDefs.h>
#include <LYCharUtils.h>
+#include <LYCharSets.h>
#ifdef DIRED_SUPPORT
#include <LYUpload.h>
@@ -166,7 +167,29 @@
FREE(address);
LYEntify(&Address, TRUE);
if (title && *title) {
+ char *tmp_buffer = NULL;
+ extern HTCJKlang HTCJK;
+
+ if (HTCJK == JAPANESE) {
+ if ((tmp_buffer = (char *) malloc (strlen(title)+1)) == 0)
+ outofmem(__FILE__, "showlist");
+ 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:
+ CTRACE((tfp, "\nshowlist: kanji_code is an unexpected value."));
+ strcpy(tmp_buffer, title);
+ break;
+ }
+ StrAllocCopy(Title, tmp_buffer);
+ FREE(tmp_buffer);
+ } else {
StrAllocCopy(Title, title);
+ }
LYEntify(&Title, TRUE);
if (*Title) {
cp = strchr(Address, '#');
diff -bru orig/lynx2-8-3/src/LYMap.c lynx2-8-3/src/LYMap.c
--- orig/lynx2-8-3/src/LYMap.c Thu Nov 4 11:41:38 1999
+++ lynx2-8-3/src/LYMap.c Mon Mar 20 09:12:42 2000
@@ -420,6 +420,8 @@
BOOL old_cache_setting = LYforce_no_cache;
BOOL old_reloading = reloading;
HTFormat old_format_out = HTOutputFormat;
+ extern HTCJKlang HTCJK;
+ char *tmp_buffer = NULL;
if (!strncasecomp(arg, "LYNXIMGMAP:", 11)) {
address = (char * )(arg + 11);
@@ -598,7 +600,26 @@
PUTS(" TYPE=\"internal link\"");
#endif
PUTS("\n>");
+ if (HTCJK == JAPANESE) {
+ if ((tmp_buffer = (char *) malloc (strlen(new->title)+1)) == 0)
+ outofmem(__FILE__, "LYLoadIMGmap");
+ switch(kanji_code) {
+ case EUC:
+ TO_EUC((CONST unsigned char *) new->title, (unsigned char *)
+tmp_buffer);
+ break;
+ case SJIS:
+ TO_SJIS((CONST unsigned char *) new->title, (unsigned char *)
+tmp_buffer);
+ break;
+ default:
+ CTRACE((tfp, "\nLYLoadIMGmap: kanji_code is an unexpected value."));
+ strcpy(tmp_buffer, new->title);
+ break;
+ }
+ StrAllocCopy(MapTitle, tmp_buffer);
+ FREE(tmp_buffer);
+ } else {
StrAllocCopy(MapTitle, new->title);
+ }
LYEntify(&MapTitle, TRUE);
PUTS(MapTitle);
PUTS("</a>\n");
diff -bru orig/lynx2-8-3/src/LYShowInfo.c lynx2-8-3/src/LYShowInfo.c
--- orig/lynx2-8-3/src/LYShowInfo.c Mon Mar 13 09:38:38 2000
+++ lynx2-8-3/src/LYShowInfo.c Mon Mar 20 09:59:08 2000
@@ -11,6 +11,7 @@
#include <LYCharUtils.h>
#include <GridText.h>
#include <LYReadCFG.h>
+#include <LYCharSets.h>
#include <LYLeaks.h>
@@ -42,10 +43,12 @@
#ifdef ADVANCED_INFO
BOOLEAN LYInfoAdvanced = (BOOL) (user_mode == ADVANCED_MODE);
#endif
+ char *tmp_buffer = NULL;
#ifdef DIRED_SUPPORT
struct stat dir_info;
#endif /* DIRED_SUPPORT */
+ extern HTCJKlang HTCJK;
if (LYReuseTempfiles) {
fp0 = LYOpenTempRewrite(tempfile, HTML_SUFFIX, "w");
@@ -229,7 +232,26 @@
fprintf(fp0, "<h2>%s</h2>\n<dl compact>",
gettext("File that you are currently viewing"));
+ if (HTCJK == JAPANESE) {
+ if ((tmp_buffer = (char *) malloc (strlen(doc->title)+1)) == 0)
+ outofmem(__FILE__, "showlist");
+ 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:
+ CTRACE((tfp, "\nshowlist: kanji_code is an unexpected value."));
+ strcpy(tmp_buffer, doc->title);
+ break;
+ }
+ StrAllocCopy(Title, tmp_buffer);
+ FREE(tmp_buffer);
+ } else {
StrAllocCopy(Title, doc->title);
+ }
LYEntify(&Title, TRUE);
fprintf(fp0, "<dt><em>%s</em> %s%s\n",
gettext("Linkname:"),