aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorsath <sath@yandex-team.com>2024-08-12 00:10:50 +0300
committersath <sath@yandex-team.com>2024-08-12 00:22:07 +0300
commit480038df25b9267a11b390666e5077cad0529a5e (patch)
tree793077532d0a912d3e0164ca5cf3071546bfe0fe /util
parent607926f2ff676273639ca567fa5f3c46f0842a03 (diff)
downloadydb-480038df25b9267a11b390666e5077cad0529a5e.tar.gz
Extract convertion WideToUTF8 to common header.
cd41123eb7362c215988a76cd95a015fcfffbd64
Diffstat (limited to 'util')
-rw-r--r--util/charset/wide.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/charset/wide.h b/util/charset/wide.h
index 2b52bb4f12..5a81f8aa47 100644
--- a/util/charset/wide.h
+++ b/util/charset/wide.h
@@ -465,6 +465,16 @@ inline TString WideToUTF8(const wchar16* text, size_t len) {
return s;
}
+#if defined(_win_)
+inline TString WideToUTF8(const wchar_t* text, size_t len) {
+ return WideToUTF8(reinterpret_cast<const wchar16*>(text), len);
+}
+
+inline std::string WideToUTF8(std::wstring_view text) {
+ return WideToUTF8(text.data(), text.size()).ConstRef();
+}
+#endif
+
inline TString WideToUTF8(const wchar32* text, size_t len) {
TString s = TString::Uninitialized(WideToUTF8BufferSize(len));
size_t written = 0;