diff options
author | mowgli <mowgli@yandex-team.ru> | 2022-02-10 16:49:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:25 +0300 |
commit | 56c39b3cf908e7202b1f7551a1653681e8015607 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/charset/wide.h | |
parent | 89afbbe4ca0e02e386dd4df08f7945f190dc1b84 (diff) | |
download | ydb-56c39b3cf908e7202b1f7551a1653681e8015607.tar.gz |
Restoring authorship annotation for <mowgli@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/charset/wide.h')
-rw-r--r-- | util/charset/wide.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/util/charset/wide.h b/util/charset/wide.h index 86433fbef1..04e6928aab 100644 --- a/util/charset/wide.h +++ b/util/charset/wide.h @@ -353,8 +353,8 @@ inline TWtringBuf UTF8ToWide(const TStringBuf src, TUtf16String& dst) { UTF8ToWideImpl<robust>(src.data(), src.size(), dst.begin(), written); dst.resize(written); return dst; -} - +} + //! if not robust will stop at first error position template <bool robust> inline TUtf32StringBuf UTF8ToUTF32(const TStringBuf src, TUtf32String& dst) { @@ -371,8 +371,8 @@ inline TWtringBuf UTF8ToWide(const TStringBuf src, TUtf16String& dst) { inline TUtf16String UTF8ToWide(const char* text, size_t len) { return UTF8ToWide<false>(text, len); -} - +} + template <bool robust> inline TUtf16String UTF8ToWide(const TStringBuf s) { return UTF8ToWide<robust>(s.data(), s.size()); @@ -387,8 +387,8 @@ inline TUtf32String UTF8ToUTF32(const TStringBuf s) { inline TUtf16String UTF8ToWide(const TStringBuf s) { return UTF8ToWide<false>(s.data(), s.size()); -} - +} + //! converts text from unicode to UTF8 //! @attention destination buffer must be long enough to fit all characters of the text, //! @c WriteUTF8Char converts @c wchar32 into maximum 4 bytes of UTF8 so @@ -417,8 +417,8 @@ inline TStringBuf WideToUTF8(const TWtringBuf src, TString& dst) { Y_ASSERT(dst.size() >= written); dst.remove(written); return dst; -} - +} + inline TString WideToUTF8(const wchar16* text, size_t len) { TString s = TString::Uninitialized(WideToUTF8BufferSize(len)); size_t written = 0; |