String to LPCWSTR in c++
问题 I'm trying to convert from string to LPCWSTR (I use multi-bite). 1) For example: LPCWSTR ToLPCWSTR(string text) { LPCWSTR sw = (LPCWSTR)text.c_str(); return sw; } 2) This returns Chinese characters: LPCWSTR ToLPCWSTR(string text) { std::wstring stemp = std::wstring(text.begin(), text.end()); LPCWSTR sw = (LPCWSTR)stemp.c_str(); return sw; } However, they both always shows squares: Image EDITED: My code with an edit by: Barmak Shemirani std::wstring get_utf16(const std::string &str, int