Of wchar_t and WCHAR and incompatibilities....

Dan Kegel dank at kegel.com
Fri Dec 26 06:16:05 CST 2003


Subhobroto Sinha wrote:
> As most of you might be aware, I and Robert are progressing with a Start Menu.

Yay!

> However, I had to write a .lnk parser for it and till date, I made it compatible ONLY with UTF-8 and thus did not require to use glibc's Unicode functions.

I'm personally a huge fan of Unicode and utf-8, but
I wonder if it's practical to not support other encodings...

> void ConvertWCHARTo_wchar_t(const WCHAR* wszIn,wchar_t* wszOut)
> {
> 	if(wszIn) while(*wszOut++=*wszIn++);
> }
> 
> and vice versa for the opposite conversion.
> 
> Believe me, it works, but not always... (any body interested in debugging with the source, please ask me for it..)

That looks pretty ugly.  Might be a sign you want to rethink a bit.

> Any sugestions as to handle the situation please?
> I need to use GLibc's Unicode functions and NOT WINE's implmentation of Mutibyte...(), because I want to keep the .lnk parser in pure C++

I was under the impression that we were trying very hard to
make sure that most parts of Wine could compile and run on
pure Windows.  (What better way to verify correctness than
to demonstrate that a .dll or .exe obeys Win32 properly than
to run it in Win32's native environment?)
Thus it seems to me you'd want to base the Start menu program
not on glibc's unicode support, but rather on Windows' 
internationalization...
- Dan




More information about the wine-devel mailing list