libc: fix UTF-16 printf strings and precision limits

This commit is contained in:
nmzik
2026-09-06 07:28:19 +04:00
parent b346f58b73
commit 0456f5a06b
2 changed files with 33 additions and 21 deletions
+2 -3
View File
@@ -316,10 +316,9 @@ inline std::string SafeCsv(std::string_view text) {
return std::string(text);
}
inline std::string Utf16ToUtf8(const char16_t* utf16) {
std::u16string input(utf16);
inline std::string Utf16ToUtf8(std::u16string_view utf16) {
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
return convert.to_bytes(input);
return convert.to_bytes(utf16.begin(), utf16.end());
}
inline ByteBuffer HexToBin(std::string_view text) {