diff --git a/shell/platform/windows/string_conversion.cc b/shell/platform/windows/string_conversion.cc index 1519337a0acba..d3ab3143ea7f6 100644 --- a/shell/platform/windows/string_conversion.cc +++ b/shell/platform/windows/string_conversion.cc @@ -8,7 +8,7 @@ namespace flutter { -std::string Utf8FromUtf16(const std::wstring& utf16_string) { +std::string Utf8FromUtf16(const std::wstring_view utf16_string) { if (utf16_string.empty()) { return std::string(); } @@ -30,7 +30,7 @@ std::string Utf8FromUtf16(const std::wstring& utf16_string) { return utf8_string; } -std::wstring Utf16FromUtf8(const std::string& utf8_string) { +std::wstring Utf16FromUtf8(const std::string_view utf8_string) { if (utf8_string.empty()) { return std::wstring(); } diff --git a/shell/platform/windows/string_conversion.h b/shell/platform/windows/string_conversion.h index ce84be2f46f85..b79aed4711072 100644 --- a/shell/platform/windows/string_conversion.h +++ b/shell/platform/windows/string_conversion.h @@ -11,11 +11,11 @@ namespace flutter { // Converts a string from UTF-16 to UTF-8. Returns an empty string if the // input is not valid UTF-16. -std::string Utf8FromUtf16(const std::wstring& utf16_string); +std::string Utf8FromUtf16(const std::wstring_view utf16_string); // Converts a string from UTF-8 to UTF-16. Returns an empty string if the // input is not valid UTF-8. -std::wstring Utf16FromUtf8(const std::string& utf8_string); +std::wstring Utf16FromUtf8(const std::string_view utf8_string); } // namespace flutter