LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Convert UTF-8 to wchar_t (https://www.linuxquestions.org/questions/programming-9/convert-utf-8-to-wchar_t-692023/)

navinkaus 12-21-2008 07:03 AM

Convert UTF-8 to wchar_t
 
I need to convert a string from UTF8 to wide character (wchar_t *). I
perform the same in windows using:

MultiByteToWideChar(CP_UTF8, 0, pInput, -1, , nLen);

What API can be used on linux or common API which will work on windows/linux ?

Thanks,
Navin

jcookeman 12-21-2008 07:51 AM

This is what you are after:

http://www.gnu.org/software/libc/man...r-Set-Handling

In regards to cross platform API, there is a glibc port for Windows, but I don't know what state it is in. GTK would probably be a good library to look at for cross platform C development.


All times are GMT -5. The time now is 03:02 AM.