wstring to string / string to wstring
for utf16 parsing error
#include <locale>
#include <codecvt>
#include <string>
#include <codecvt>
#include <string>
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::string Str_UTF8 = converter.to_bytes(utf16String);
std::wstring wideString_UTF16 = converter.from_bytes(utf8String);
For use, you should modify the bold writing.
#utf16 #utf8 #wstring #string #C #C++ #Embedded #Linux
No comments:
Post a Comment