diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-03-31 17:42:46 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-03-31 17:42:46 -0700 |
| commit | 1e33e2e21362611e350b22f401f25eb50366a2bd (patch) | |
| tree | 3da419340704a0c59ce177533cc4a8b2b2e46be3 | |
| parent | 77c90c2df532bed65cd77ef85f6a0b6140a214d3 (diff) | |
| download | vcpkg-1e33e2e21362611e350b22f401f25eb50366a2bd.tar.gz vcpkg-1e33e2e21362611e350b22f401f25eb50366a2bd.zip | |
Use cstring_view in utf conversion functions
| -rw-r--r-- | toolsrc/include/vcpkg_Strings.h | 4 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Strings.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 879542a94..db3851755 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -99,9 +99,9 @@ namespace vcpkg::Strings return details::wformat_internal(fmtstr, to_wprintf_arg(to_wprintf_arg(args))...); } - std::wstring utf8_to_utf16(const std::string& s); + std::wstring utf8_to_utf16(const cstring_view s); - std::string utf16_to_utf8(const std::wstring& w); + std::string utf16_to_utf8(const cwstring_view w); std::string::const_iterator case_insensitive_ascii_find(const std::string& s, const std::string& pattern); diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 044fd3c05..52f32bfa4 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -50,13 +50,13 @@ namespace vcpkg::Strings::details namespace vcpkg::Strings { - std::wstring utf8_to_utf16(const std::string& s) + std::wstring utf8_to_utf16(const cstring_view s) { std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> conversion; return conversion.from_bytes(s); } - std::string utf16_to_utf8(const std::wstring& w) + std::string utf16_to_utf8(const cwstring_view w) { std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> conversion; return conversion.to_bytes(w); |
