Menu

#127 Japanese conversion

closed-wont-fix
nobody
None
5
2006-03-11
2004-09-06
Anonymous
No

shige 09/06 2004
----------------

For Japanese word file, I found some problems.

1) In wvHtml, stylename is not correct chaset string.
In default,

(body string,stylename)==(UTF-8,not correct charset),

and in case with --charset=EUC-JP,

(body string,stylename)==(EUC-JP,UTF-8).

This is because

iconv_handle = iconv_open(outputtype, "ISO-8859-1");

in wvConvertStylename().

2) In wvLatex, Japanese charcters becomes

[xxxx][xxxx]....

This is because

if (char16 > 0x80)
{
printf ("[%x]", char16);

in wvConvertUnicodeToLaTeX().

I fixed them by the following path:

----- from here -----
diff -uN wv-1.0.2/text.c.ORG wv-1.0.2/text.c
--- wv-1.0.2/text.c.ORG Tue Jan 20 10:06:43 2004
+++ wv-1.0.2/text.c Mon Sep 6 16:23:57 2004
@@ -1934,11 +1934,13 @@

}
/* Debugging aid: */
+#if 0
if (char16 >= 0x80)
{
printf ("[%x]", char16);
return (1);
}
+#endif
return (0);
}

@@ -2157,7 +2159,7 @@
#define BUF_COPY(d,s) str_copy(d,sizeof(d),s)

char *
-wvConvertStylename(char *stylename, char *outputtype)
+wvConvertStylename(char *stylename, char *outputtype,
char *orgcharset)
{
static char cached_outputtype[36];
static iconv_t iconv_handle = (iconv_t)-1;
@@ -2182,11 +2184,16 @@

/**FIXME: don<B4>t know if ISO-8859-1 is really
the correct
**charset for style names with eg
umlauts. **/
+#if 0
iconv_handle = iconv_open(outputtype,
"ISO-8859-1");
+#else
+ if(orgcharset==NULL) orgcharset="ISO-8859-1";
+ iconv_handle = iconv_open(outputtype,
orgcharset);
+#endif
if(iconv_handle == (iconv_t)-1)
{
wvError(("iconv_open fail: %d, cannot
convert %s to %s\n",
- errno, "ISO-8859-1", outputtype));
+ errno, orgcharset, outputtype));
return stylename;
}

diff -uN wv-1.0.2/wv.h.ORG wv-1.0.2/wv.h
--- wv-1.0.2/wv.h.ORG Mon May 12 19:23:07 2003
+++ wv-1.0.2/wv.h Mon Sep 6 16:25:30 2004
@@ -2939,7 +2939,8 @@

int wvConvertUnicodeToHtml (U16 char16);
int wvConvertUnicodeToXml (U16 char16);
- char *wvConvertStylename(char *stylename, char
*outputtype);
+ char *wvConvertStylename(char *stylename, char
*outputtype,
+ char *orgcharset);
int wvConvertUnicodeToLaTeX (U16 char16);
U16 wvConvertSymbolToUnicode (U16 char16);
U16 wvConvertMTExtraToUnicode (U16 char16);
diff -uN wv-1.0.2/wvConfig.c.ORG wv-1.0.2/wvConfig.c
--- wv-1.0.2/wvConfig.c.ORG Sun Jul 14 22:20:07
2002
+++ wv-1.0.2/wvConfig.c Mon Sep 6 16:20:53 2004
@@ -1735,7 +1735,8 @@
wvAppendStr (&mydata->retstring,
pap->stylename);
#else
wvAppendStr(&mydata->retstring,
-
wvConvertStylename(pap->stylename, mydata->charset));
+
wvConvertStylename(pap->stylename, mydata->charset,
+
wvAutoCharset(mydata->ps)));
#endif
mydata->currentlen = strlen
(mydata->retstring);
break;
----- to here -----

+========================================================+
Shigeharu TAKENO NIigata Institute of Technology
kashiwazaki,Niigata 945-1195
JAPAN
shige@iee.niit.ac.jp TEL(&FAX): +81-257-22-8161
+========================================================+

Discussion

  • Nobody/Anonymous

    Logged In: NO

    shige 09/06 2004
    ----------------

    Sorry, I forgot to write version.
    I tested wv-1.0.2 on Solaris 2.6 (SPARC).

    +========================================================+
    Shigeharu TAKENO NIigata Institute of Technology
    kashiwazaki,Niigata 945-1195 JAPAN
    shige@iee.niit.ac.jp TEL(&FAX): +81-257-22-8161
    +========================================================+

     
  • Dom Lachowicz

    Dom Lachowicz - 2006-03-11
    • status: open --> closed-wont-fix
     
  • Dom Lachowicz

    Dom Lachowicz - 2006-03-11

    Logged In: YES
    user_id=69417

    Please use AbiWord --to=html instead. wvHtml is deprecated.
    Thanks.

     

Log in to post a comment.