mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 22:06:59 +01:00
fix: windows build failure in UTF-16 conversion (#499)
This commit is contained in:
@@ -317,8 +317,11 @@ inline std::string SafeCsv(std::string_view text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline std::string Utf16ToUtf8(std::u16string_view utf16) {
|
inline std::string Utf16ToUtf8(std::u16string_view utf16) {
|
||||||
|
if (utf16.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
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(utf16.begin(), utf16.end());
|
return convert.to_bytes(utf16.data(), utf16.data() + utf16.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ByteBuffer HexToBin(std::string_view text) {
|
inline ByteBuffer HexToBin(std::string_view text) {
|
||||||
|
|||||||
Reference in New Issue
Block a user