Home | History | Annotate | Download | only in base

Lines Matching refs:utf8

19 #include "android-base/utf8.h"
42 bool WideToUTF8(const wchar_t* utf16, const size_t size, std::string* utf8) {
43 utf8->clear();
69 utf8->resize(chars_required);
72 &(*utf8)[0], chars_required, NULL,
78 utf8->clear();
85 bool WideToUTF8(const wchar_t* utf16, std::string* utf8) {
87 return WideToUTF8(utf16, wcslen(utf16), utf8);
90 bool WideToUTF8(const std::wstring& utf16, std::string* utf8) {
93 return WideToUTF8(utf16.c_str(), utf16.length(), utf8);
97 static bool UTF8ToWideWithFlags(const char* utf8, const size_t size, std::wstring* utf16,
107 const int chars_required = MultiByteToWideChar(CP_UTF8, flags, utf8, size,
117 const int result = MultiByteToWideChar(CP_UTF8, flags, utf8, size,
130 bool UTF8ToWide(const char* utf8, const size_t size, std::wstring* utf16) {
132 if (UTF8ToWideWithFlags(utf8, size, utf16, MB_ERR_INVALID_CHARS)) {
140 (void)UTF8ToWideWithFlags(utf8, size, utf16, 0);
145 bool UTF8ToWide(const char* utf8, std::wstring* utf16) {
147 return UTF8ToWide(utf8, strlen(utf8), utf16);
150 bool UTF8ToWide(const std::string& utf8, std::wstring* utf16) {
153 return UTF8ToWide(utf8.c_str(), utf8.length(), utf16);
157 namespace utf8 {
185 } // namespace utf8