Re: -fshort-wchar option, wchar_t and Native<->Unicode conversion

Jungshik Shin <[email protected]> Fri, 23 May 2003 08:45:30 +0900
Newsgroups gmane.comp.mozilla.internationalization,gmane.comp.mozilla.devel.unix,gmane.comp.mozilla.devel.xpcom
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Jungshik Shin wrote:

> In 
> http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsNativeCharsetUtils.cpp#623, 
> 
> 
> it's assumed that *wchar_t is the same as *PRUnichar when 
> gWCharIsUnicode is true. I'm wondering if it's always the case.
> 
> At the momemnt, Linux build is made with '-fshort-wchar' option to gcc. 
> With that option, wchar_t is short(2byte) and *wchar_t is the same as 
> *PRUnichar as far as non-BMP char is concerned. Even in that case, I'm 
> not sure *wchar_t is identical to *PRUnichar. It's to be note that 
> *PRUnichar is NOT a string of UCS2 BUT a 'UTF-16 string'. I'm not sure 
......

> A possible work-around for this problem is to use 'iconv' in place of mb 
> rtowc and wcrtomb.


   I'm sorry I didn't realize that there's another section of codes in 
nsNativeCharsetutils.cpp that uses iconv(3). So, what I wrote above can 
be ignored. However, I find that iconv(3) is invoked with UCS-2 instead 
of UTF-16. I'm gonna file a bug for this.

   Jungshik