diff options
author | jackpoz <giacomopoz@gmail.com> | 2016-08-06 16:28:46 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2016-08-06 16:28:46 +0200 |
commit | 4170a9357caf8987e40335f3ae2298b2dfaeb86e (patch) | |
tree | b0288cb3fd56326858a01d2e4336da1646b9f191 /src/common/Utilities/Util.h | |
parent | d7602190623153c8f211ad120e22c6e63371f3db (diff) |
Common/Utilities: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
Diffstat (limited to 'src/common/Utilities/Util.h')
-rw-r--r-- | src/common/Utilities/Util.h | 5 |
1 files changed, 4 insertions, 1 deletions
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) |