From 5a85c8a95b35bae8730fd734ec5b4a6a3c575456 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 14 Sep 2021 12:16:29 +0300 Subject: [PATCH] Improve error message. --- tdutils/td/utils/port/wstring_convert.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tdutils/td/utils/port/wstring_convert.cpp b/tdutils/td/utils/port/wstring_convert.cpp index 45ad32065..c81d0695f 100644 --- a/tdutils/td/utils/port/wstring_convert.cpp +++ b/tdutils/td/utils/port/wstring_convert.cpp @@ -10,6 +10,8 @@ char disable_linker_warning_about_empty_file_wstring_convert_cpp TD_UNUSED; #if TD_PORT_WINDOWS +#include "td/utils/base64.h" +#include "td/utils/SliceBuilder.h" #include "td/utils/utf8.h" #include @@ -18,7 +20,7 @@ namespace td { Result to_wstring(CSlice slice) { if (!check_utf8(slice)) { - return Status::Error("Wrong string encoding"); + return Status::Error(PSLICE() << "String was expected to be encoded in UTF-8: " << base64_encode(slice)); } size_t wstring_len = utf8_utf16_length(slice);