[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Lynx-dev] patch for EXP_JAPANESEUTF8_SUPPORT
From: |
patakuti |
Subject: |
[Lynx-dev] patch for EXP_JAPANESEUTF8_SUPPORT |
Date: |
Sat, 14 Jan 2006 10:16:55 +0900 (JST) |
I wrote a patch to improve EXP_JAPANESEUTF8_SUPPORT stuff.
- correct a mistake of defining macro in HTMIME.c
- correct the behavior of encoding a text in input element,
when the type is hidden and the text is japanese encoded utf-8.
- correct "//TRANSLIT" position in iconv_open parameter.
--
Takeshi Hataguchi
E-mail: address@hidden
diff -rub orig/lynx2-8-6/WWW/Library/Implementation/HTMIME.c
lynx2-8-6/WWW/Library/Implementation/HTMIME.c
--- orig/lynx2-8-6/WWW/Library/Implementation/HTMIME.c 2005-10-17
09:17:20.000000000 +0900
+++ lynx2-8-6/WWW/Library/Implementation/HTMIME.c 2006-01-14
09:02:40.000000000 +0900
@@ -308,7 +308,7 @@
UCT_SETBY_DEFAULT);
}
if ((p_in->enc != UCT_ENC_CJK)
-#ifndef EXP_JAPANESEUTF8_SUPPORT
+#ifdef EXP_JAPANESEUTF8_SUPPORT
&& ((p_in->enc != UCT_ENC_UTF8)
|| (p_out->enc != UCT_ENC_CJK))
#endif
diff -rub orig/lynx2-8-6/src/GridText.c lynx2-8-6/src/GridText.c
--- orig/lynx2-8-6/src/GridText.c 2005-12-19 07:52:30.000000000 +0900
+++ lynx2-8-6/src/GridText.c 2006-01-14 09:46:08.000000000 +0900
@@ -9706,7 +9706,7 @@
*/
if (I->value)
StrAllocCopy(IValue, I->value);
- if (IValue && HTCJK != NOCJK) {
+ if (IValue && HTCJK != NOCJK && ((I->type == NULL) || strcasecomp(I->type,
"hidden"))) {
if ((tmp = typecallocn(unsigned char, strlen(IValue) * 2 + 1)) != 0) {
if (kanji_code == EUC) {
TO_EUC((unsigned char *) IValue, tmp);
diff -rub orig/lynx2-8-6/src/UCdomap.c lynx2-8-6/src/UCdomap.c
--- orig/lynx2-8-6/src/UCdomap.c 2005-12-19 07:52:30.000000000 +0900
+++ lynx2-8-6/src/UCdomap.c 2006-01-14 09:02:40.000000000 +0900
@@ -941,6 +941,7 @@
iconv_t cd;
char str[3], *pin, *pout;
size_t inleft, outleft;
+ char *tocode = NULL;
str[0] = unicode >> 8;
str[1] = unicode & 0xFF;
@@ -948,8 +949,9 @@
pin = str;
inleft = 2;
pout = outbuf, outleft = buflen;
- cd = iconv_open(LYCharSet_UC[charset_out].MIMEname,
- "UTF-16BE//TRANSLIT");
+ HTSprintf0(&tocode, "%s//TRANSLIT",
LYCharSet_UC[charset_out].MIMEname);
+ cd = iconv_open(tocode, "UTF-16BE");
+ FREE(tocode)
rc = iconv(cd, &pin, &inleft, &pout, &outleft);
iconv_close(cd);
if ((pout - outbuf) == 3) {
- [Lynx-dev] patch for EXP_JAPANESEUTF8_SUPPORT,
patakuti <=