I have created a CJK patch such that links can display CJK correctly.
It has been used by me for quite some time now. It has been sent to
the links mailing list but seems to be ignored somehow... Thanks if it
can be included in Debian.
*** links-0.92-cjk.patch
diff -uNr links-0.92.orig/charsets.c links-0.92/charsets.c
--- links-0.92.orig/charsets.c Sat Sep 9 09:20:57 2000
+++ links-0.92/charsets.c Sat Sep 9 09:51:22 2000
@@ -94,7 +94,7 @@
int j, s;
if (u < 128) return strings[u];
if (u == 0xa0) return "\001";
- if (u == 0xad) return "";
+ if (!is_cjk_cp(to) && u == 0xad) return "";
if (u < 0xa0) {
if (!strange_chars[u - 0x80]) return NULL;
return u2cp(strange_chars[u - 0x80], to);
@@ -359,4 +359,9 @@
int is_cp_special(int index)
{
return codepages[index].table == table_utf_8;
+}
+
+int is_cjk_cp(int index)
+{
+ return ! strcmp(codepages[index].name, "CJK");
}
diff -uNr links-0.92.orig/codepage.inc links-0.92/codepage.inc
--- links-0.92.orig/codepage.inc Fri Jun 30 06:03:44 2000
+++ links-0.92/codepage.inc Sat Sep 9 09:50:07 2000
@@ -2208,6 +2208,8 @@
unsigned char *aliases_utf_8 [] = {"utf-8", "utf8", NULL };
+unsigned char *aliases_cjk [] = {"BIG-5", "BIG5", "GB-2312", "GB2312", "JIS", "SJIS", "X-SJIS", "Shift_JIS", "iso-2022-jp", "euc-kr", NULL };
+
struct codepage_desc codepages [] = {
"7-bit ASCII", aliases_7bit, table_7bit,
"ISO 8859-1", aliases_8859_1, table_8859_1,
@@ -2228,5 +2230,6 @@
"KOI8-R", aliases_koi8_r, table_koi8_r,
"KOI8-U", aliases_koi8_u, table_koi8_u,
"Unicode UTF-8", aliases_utf_8, table_utf_8,
+ "CJK", aliases_cjk, table_8859_1,
NULL, NULL, NULL
};
diff -uNr links-0.92.orig/links.h links-0.92/links.h
--- links-0.92.orig/links.h Mon Jun 19 00:36:55 2000
+++ links-0.92/links.h Sat Sep 9 09:43:25 2000
@@ -1651,6 +1651,7 @@
unsigned char *get_cp_name(int);
unsigned char *get_cp_mime_name(int);
int is_cp_special(int);
+int is_cjk_cp(int);
void free_conv_table();
/* view.c */