View Full Version : Porting MultiByteToWideChar to Unix

01-10-2005, 09:59 AM

I would need to port the WinAPI functions MultiByteToWideChar and WideCharToMultiByte to Unix.
Specifically, the call is :
MultiByteToWideChar(CP_ACP, 0, AnsiStr, -1, UnicodeStr, sizeof(UnicodeStr));

I know that mbcstowcs() call should help me in the porting but I do not know how to handle the first parameter CP_ACP in Unix ie. setting the code page to Ansi .

Should it be done by calling setlocale(LC_CTYPE,"") or is there any other method ?

Any help will be highly appreciated


01-25-2005, 09:42 AM
I don't know how to port MultiByteToWideChar to Unix, sorry.

But "iconv" system call in Unix should be easy to use to do the same thing. For detail, try

man 3 iconv
iconv -l

Hope this help.