temp fix for U16toU8 edgecase

This commit is contained in:
CPunch 2020-08-21 22:11:04 -05:00
parent cff382a8ce
commit f71e1349c1

View File

@ -1,8 +1,12 @@
#include "CNStructs.hpp" #include "CNStructs.hpp"
std::string U16toU8(char16_t* src) { std::string U16toU8(char16_t* src) {
try {
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert; std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert;
return convert.to_bytes(src); return convert.to_bytes(src);
} catch(std::exception e) {
return "";
}
} }
// returns number of char16_t that was written at des // returns number of char16_t that was written at des