Re: Patch: Fix for Bug 1164, 2nd try


Subject: Re: Patch: Fix for Bug 1164, 2nd try
From: Hubert Figuiere (hfiguiere@teaser.fr)
Date: Tue May 22 2001 - 03:58:44 CDT


According to Vlad Harchev <hvv@hippo.ru>:
> On Tue, 22 May 2001, ha shao wrote:
>
>
> > Patch to add codepage items for Chinese. Really useful?
>
> It would be nice to commit it.
>
> Also everywhere, CJK hackers told us that not all iconv
> implementations know "CP950" and "CP936" under these names - if it's true for
> iconv AW is linked with, fallback charset names "BIG5" and "GB2312" should be
> used.
>
> So, I'd suggest to change the code as I did for Wv in text.c -
>
> #define CPNAME_OR_FALLBACK(destination,name,fallbackname) \
> { \
> static char* cpname = NULL; \
> if (!cpname) \
> { \
> iconv_t cd = iconv_open(name,name); \
> if (cd==(iconv_t)-1) \
> { \
> cpname = fallbackname; \
> } \
> else \
> { \
> cpname = name; \
> iconv_close(cd); \
> } \
> }; \
> destination = cpname; \
> }
>
> And instead of something like this
> m_szEncoding = "CP936";
> something like this should be used:
> CPNAME_OR_FALLBACK(m_szEncoding,"CP936","GB2312");
>
> Both switches should be modified (the one that maps encoding number to
> charset name, and the one that maps font charset number to encoding name).
> Could somebody fix this?

The idea is good, but I find this time consuming.... since iconv check
will be done each time encoding is changed to this value. I keep the idea
in mind and find a smarter way to go.

Hub



This archive was generated by hypermail 2b25 : Sat May 26 2001 - 03:51:06 CDT