diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/charset/recyr.hh | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/charset/recyr.hh')
-rw-r--r-- | library/cpp/charset/recyr.hh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/charset/recyr.hh b/library/cpp/charset/recyr.hh index e0af996ae9..5ec8734bcf 100644 --- a/library/cpp/charset/recyr.hh +++ b/library/cpp/charset/recyr.hh @@ -110,7 +110,7 @@ inline RECODE_RESULT Recode(ECharset from, ECharset to, const char* in, char* ou * @return false if conversion was not attempted (charsets were the same), * true if successful */ -inline bool Recode(ECharset from, ECharset to, const TStringBuf& in, TString& out) { +inline bool Recode(ECharset from, ECharset to, const TStringBuf& in, TString& out) { if (to == from) return false; @@ -132,23 +132,23 @@ inline bool Recode(ECharset from, ECharset to, const TStringBuf& in, TString& ou } /////////////////////////////////////////////////////////////////////////////////////// -// TString -> TString // +// TString -> TString // /////////////////////////////////////////////////////////////////////////////////////// -inline TString Recode(ECharset from, ECharset to, const TString& in) { - TString out; +inline TString Recode(ECharset from, ECharset to, const TString& in) { + TString out; return to != from && Recode(from, to, in, out) ? out : in; } -inline TString RecodeToYandex(ECharset from, const TString& in) { +inline TString RecodeToYandex(ECharset from, const TString& in) { return Recode(from, CODES_YANDEX, in); } -inline TString RecodeFromYandex(ECharset to, const TString& in) { +inline TString RecodeFromYandex(ECharset to, const TString& in) { return Recode(CODES_YANDEX, to, in); } -inline TString RecodeToHTMLEntities(ECharset from, const TString& in) { +inline TString RecodeToHTMLEntities(ECharset from, const TString& in) { RECODE_RESULT res; size_t outWritten, inRead; - TString out; + TString out; out.resize(in.length() * (4 + 4)); res = NCodepagePrivate::_recodeToHTMLEntities(from, in.c_str(), out.begin(), in.length(), out.length(), inRead, outWritten); if (res == RECODE_EOOUTPUT) { //input contains many 8-byte characters? |