Of wchar_t and WCHAR and incompatibilities....

Troy Rollo wine at troy.rollo.name
Sun Dec 28 15:15:53 CST 2003


On Fri, 26 Dec 2003 05:50, Subhobroto Sinha wrote:
> As a result, Unicode strings on Windows are unsigned long arrays and thus I
> had to convert them into glibc's own wchar_t format using a hack like
> this:
> void ConvertWCHARTo_wchar_t(const WCHAR* wszIn,wchar_t* wszOut)
> {
>    if(wszIn) while(*wszOut++=*wszIn++);
> }
> ...
> Believe me, it works, but not always... 

You haven't mentioned what your bug is, however Windows doesn't really use 
Unicode (UCS-4, a 32 bit character set), nor does it use 16 bit unicode 
(UCS-2). It uses UTF-16, in which there are a couple of ranges of characters 
used to create two-word sequences to represent a larger chunk of UCS-4. Your 
code doesn't deal with that.




More information about the wine-devel mailing list