I would like to convert a char*
string to a wchar*
string in C.
I have found many answers, but most of them are for C++. Could you help me?
Thanks.
If you happen to have the Windows API availiable, the conversion function MultiByteToWideChar offers some configurable string conversion from different encodings to UTF-16. That might be more appropriate if you don't care too much about portability and don't want to figure out exactly what the implications of different locale settings are to the string converison.
setlocale()
followed bymbstowcs()
.