According to Vlad Harchev <[EMAIL PROTECTED]>:
> 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

Reply via email to