diff options
author | nga <nga@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
commit | c2a1af049e9deca890e9923abe64fe6c59060348 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/charset | |
parent | 1f553f46fb4f3c5eec631352cdd900a0709016af (diff) | |
download | ydb-c2a1af049e9deca890e9923abe64fe6c59060348.tar.gz |
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/charset')
-rw-r--r-- | util/charset/wide.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util/charset/wide.h b/util/charset/wide.h index 4c681679ee..04e6928aab 100644 --- a/util/charset/wide.h +++ b/util/charset/wide.h @@ -312,7 +312,7 @@ inline size_t UTF8ToWideImpl(const char* text, size_t len, TCharType* dest, size ::NDetail::UTF8ToWideImplScalar<robust>(cur, last, p); written = p - dest; - return cur - reinterpret_cast<const unsigned char*>(text); + return cur - reinterpret_cast<const unsigned char*>(text); } template <typename TCharType> @@ -337,15 +337,15 @@ inline bool UTF8ToWide(const char* text, size_t len, TCharType* dest, size_t& wr return UTF8ToWideImpl<robust>(text, len, dest, written) == len; } -//! converts text from UTF8 to unicode, stops immediately it UTF8 byte sequence is wrong -//! @attention destination buffer must be long enough to fit all characters of the text, -//! conversion stops if a broken symbol is met -//! @return @c true if all the text converted successfully, @c false - a broken symbol was found +//! converts text from UTF8 to unicode, stops immediately it UTF8 byte sequence is wrong +//! @attention destination buffer must be long enough to fit all characters of the text, +//! conversion stops if a broken symbol is met +//! @return @c true if all the text converted successfully, @c false - a broken symbol was found template <typename TCharType> inline bool UTF8ToWide(const char* text, size_t len, TCharType* dest, size_t& written) noexcept { return UTF8ToWide<false>(text, len, dest, written); -} - +} + template <bool robust> inline TWtringBuf UTF8ToWide(const TStringBuf src, TUtf16String& dst) { dst.ReserveAndResize(src.size()); |