From 4170a9357caf8987e40335f3ae2298b2dfaeb86e Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sat, 6 Aug 2016 16:28:46 +0200 Subject: [PATCH] Common/Utilities: Reduce differences between 3.3.5 and 6.x branches Code functionality shouldn't have been modified. --- src/common/Utilities/Util.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index 1699ca8096e..3ea2a87d985 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -112,8 +112,10 @@ inline T RoundToInterval(T& num, T floor, T ceil) // UTF8 handling TC_COMMON_API bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr); + // in wsize==max size of buffer, out wsize==real string size TC_COMMON_API bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize); + inline bool Utf8toWStr(const std::string& utf8str, wchar_t* wstr, size_t& wsize) { return Utf8toWStr(utf8str.c_str(), utf8str.size(), wstr, wsize); @@ -123,7 +125,8 @@ TC_COMMON_API bool WStrToUtf8(std::wstring const& wstr, std::string& utf8str); // size==real string size TC_COMMON_API bool WStrToUtf8(wchar_t* wstr, size_t size, std::string& utf8str); -TC_COMMON_API size_t utf8length(std::string& utf8str); // set string to "" if invalid utf8 sequence +// set string to "" if invalid utf8 sequence +TC_COMMON_API size_t utf8length(std::string& utf8str); TC_COMMON_API void utf8truncate(std::string& utf8str, size_t len); inline bool isBasicLatinCharacter(wchar_t wchar)