Flutter Engine
string_conversion.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_STRING_CONVERSION_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_STRING_CONVERSION_H_
7 
8 #include <string>
9 
10 namespace flutter {
11 
12 // Converts a string from UTF-16 to UTF-8. Returns an empty string if the
13 // input is not valid UTF-16.
14 std::string Utf8FromUtf16(const std::wstring& utf16_string);
15 
16 // Converts a string from UTF-8 to UTF-16. Returns an empty string if the
17 // input is not valid UTF-8.
18 std::wstring Utf16FromUtf8(const std::string& utf8_string);
19 
20 } // namespace flutter
21 
22 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_STRING_CONVERSION_H_
std::string Utf8FromUtf16(const std::wstring &utf16_string)
std::wstring Utf16FromUtf8(const std::string &utf8_string)