From 27ee6f02d6dec05ba4740071807bf2b47290bb3b Mon Sep 17 00:00:00 2001 From: Ali Almohaya Date: Mon, 7 Sep 2026 10:52:22 +0300 Subject: [PATCH] fix: windows build failure in UTF-16 conversion (#499) --- src/common/stringUtils.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/stringUtils.h b/src/common/stringUtils.h index ac61bc430..80fc63217 100644 --- a/src/common/stringUtils.h +++ b/src/common/stringUtils.h @@ -317,8 +317,11 @@ inline std::string SafeCsv(std::string_view text) { } inline std::string Utf16ToUtf8(std::u16string_view utf16) { + if (utf16.empty()) { + return {}; + } std::wstring_convert, 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) {