mirror of https://github.com/microsoft/vcpkg.git
Use cstring_view in utf conversion functions
This commit is contained in:
parent
77c90c2df5
commit
1e33e2e213
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue