Re: patch: insane code - locales


Subject: Re: patch: insane code - locales
From: Patrick Lam (plam@plam.lcs.mit.edu)
Date: Mon Apr 09 2001 - 14:47:48 CDT


Hi Vlad,

On Mon, 9 Apr 2001, Vlad Harchev wrote:

> The code is necessary - the iconv from libiconv dies in SIGSEGV sometimes if
> all arguments beside it are not NULL (that's a valid usage for iconv). We have
> no option beside this ugly hack or fixing iconv from libiconv by ourselves.

> > - if (XAP_EncodingManager::instance->cjk_locale())
> > - iconv(cd,const_cast<ICONV_CONST char**>((char**)NULL),NULL,NULL,NULL);
> > + iconv(cd,const_cast<ICONV_CONST char**>((char**)NULL),NULL,NULL,NULL);

So you're saying that iconv dies sometimes if all arguments are not
NULL? In this case, all of the arguments are NULL, and this seems to be
permitted by the manpage:

       A third case is when inbuf is NULL or *inbuf is NULL, and
       outbuf is NULL or *outbuf is NULL. In this case, the iconv
       function sets cd's conversion state to the initial state.

Why is it suddenly OK to execute this code if cjk_locale() is set?

pat



This archive was generated by hypermail 2b25 : Mon Apr 09 2001 - 14:51:12 CDT