diff options
author | esgv <esgv@yandex-team.ru> | 2022-02-10 16:50:24 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:24 +0300 |
commit | 555c14603bb6a3b676b9ace65d6e5a8b35a32fee (patch) | |
tree | fc3aad5265a334515cb93f346bd7addc6f9bf52a /library/cpp/charset | |
parent | beb63ece3a6872dfbe113104f524ab6fdbec0adc (diff) | |
download | ydb-555c14603bb6a3b676b9ace65d6e5a8b35a32fee.tar.gz |
Restoring authorship annotation for <esgv@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/charset')
-rw-r--r-- | library/cpp/charset/codepage.cpp | 12 | ||||
-rw-r--r-- | library/cpp/charset/codepage.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/charset/codepage.cpp b/library/cpp/charset/codepage.cpp index 0431bef31b..cb7fed9e82 100644 --- a/library/cpp/charset/codepage.cpp +++ b/library/cpp/charset/codepage.cpp @@ -13,7 +13,7 @@ #include <util/generic/vector.h> #include <util/generic/hash_set.h> #include <util/generic/singleton.h> -#include <util/generic/yexception.h> +#include <util/generic/yexception.h> #include <util/memory/pool.h> #include <cstring> @@ -197,12 +197,12 @@ ECharset CharsetByName(TStringBuf name) { } ECharset CharsetByNameOrDie(TStringBuf name) { - ECharset result = CharsetByName(name); - if (result == CODES_UNKNOWN) + ECharset result = CharsetByName(name); + if (result == CODES_UNKNOWN) ythrow yexception() << "CharsetByNameOrDie: unknown charset '" << name << "'"; - return result; -} - + return result; +} + template <typename TxChar> static inline RECODE_RESULT utf8_read_rune_from_unknown_plane(TxChar& rune, size_t& rune_len, const TxChar* s, const TxChar* end) { if ((*s & 0xFF00) != 0xF000) { diff --git a/library/cpp/charset/codepage.h b/library/cpp/charset/codepage.h index 30a02a4610..fbe8a59ede 100644 --- a/library/cpp/charset/codepage.h +++ b/library/cpp/charset/codepage.h @@ -155,9 +155,9 @@ inline const CodePage* CodePageByCharset(ECharset e) { ECharset CharsetByName(TStringBuf name); -// Same as CharsetByName, but throws yexception() if name is invalid +// Same as CharsetByName, but throws yexception() if name is invalid ECharset CharsetByNameOrDie(TStringBuf name); - + inline ECharset CharsetByCodePage(const CodePage* CP) { return CP->CPEnum; } |