diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/charset/wide.h | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/charset/wide.h')
-rw-r--r-- | library/cpp/charset/wide.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/charset/wide.h b/library/cpp/charset/wide.h index 32d30e849e..cbbfe40b58 100644 --- a/library/cpp/charset/wide.h +++ b/library/cpp/charset/wide.h @@ -58,15 +58,15 @@ namespace NDetail { template <typename TCharType> inline TBasicStringBuf<TCharType> RecodeSingleByteChar(const TStringBuf src, TCharType* dst, const CodePage& cp) { Y_ASSERT(cp.SingleByteCodepage()); - ::CharToWide(src.data(), src.size(), dst, cp); + ::CharToWide(src.data(), src.size(), dst, cp); return TBasicStringBuf<TCharType>(dst, src.size()); } template <typename TCharType> inline TStringBuf RecodeSingleByteChar(const TBasicStringBuf<TCharType> src, char* dst, const CodePage& cp) { Y_ASSERT(cp.SingleByteCodepage()); - ::WideToChar(src.data(), src.size(), dst, cp.CPEnum); - return TStringBuf(dst, src.size()); + ::WideToChar(src.data(), src.size(), dst, cp.CPEnum); + return TStringBuf(dst, src.size()); } template <typename TCharType> @@ -74,7 +74,7 @@ namespace NDetail { Y_ASSERT(!NCodepagePrivate::NativeCodepage(encoding)); size_t read = 0; size_t written = 0; - ::NICONVPrivate::RecodeToUnicode(encoding, src.data(), dst, src.size(), src.size(), read, written); + ::NICONVPrivate::RecodeToUnicode(encoding, src.data(), dst, src.size(), src.size(), read, written); return TBasicStringBuf<TCharType>(dst, written); } @@ -83,14 +83,14 @@ namespace NDetail { Y_ASSERT(!NCodepagePrivate::NativeCodepage(encoding)); size_t read = 0; size_t written = 0; - ::NICONVPrivate::RecodeFromUnicode(encoding, src.data(), dst, src.size(), src.size() * 3, read, written); + ::NICONVPrivate::RecodeFromUnicode(encoding, src.data(), dst, src.size(), src.size() * 3, read, written); return TStringBuf(dst, written); } template <typename TCharType> inline TBasicStringBuf<TCharType> RecodeUtf8(const TStringBuf src, TCharType* dst) { size_t len = 0; - if (!::UTF8ToWide(src.data(), src.size(), dst, len)) + if (!::UTF8ToWide(src.data(), src.size(), dst, len)) ythrow yexception() << "Invalid UTF8: \"" << src.SubStr(0, 50) << (src.size() > 50 ? "...\"" : "\""); return TBasicStringBuf<TCharType>(dst, len); } @@ -98,7 +98,7 @@ namespace NDetail { template <typename TCharType> inline TStringBuf RecodeUtf8(const TBasicStringBuf<TCharType> src, char* dst) { size_t len = 0; - ::WideToUTF8(src.data(), src.size(), dst, len); + ::WideToUTF8(src.data(), src.size(), dst, len); return TStringBuf(dst, len); } @@ -190,7 +190,7 @@ namespace NDetail { // do re-coding size_t written = 0; - UTF8ToWide<true>(src.data(), src.size(), dstbuf, written); + UTF8ToWide<true>(src.data(), src.size(), dstbuf, written); // truncate result back to proper size TRecodeResultOps<TResult>::Truncate(dst, written); |