For literals, you want to use L in a string, as in:
L"My String"
If you can compile with a wide character or not, you might want to use the _T() macro _T() :
_T("My String")
Wide string characters in MS-Windows use the UTF-16 format. See the Unicode website for more information on Unicode formats.
To dynamically convert a string, you need to know the format of your string char * . In most cases under Windows it is Win1252, but not always. Microsoft Windows supports many 8-bit formats, including UTF-8 and ISO-8859-1.
If you trust the locale setting, you can use the mbstowc_s() functions.
For other conversions, you can look at the MultiByteToWideChar() function
source share