Home | History | Annotate | Download | only in base

Lines Matching refs:utf8

19 #include "android-base/utf8.h"
44 bool WideToUTF8(const wchar_t* utf16, const size_t size, std::string* utf8) {
45 utf8->clear();
71 utf8->resize(chars_required);
74 &(*utf8)[0], chars_required, NULL,
80 utf8->clear();
87 bool WideToUTF8(const wchar_t* utf16, std::string* utf8) {
89 return WideToUTF8(utf16, wcslen(utf16), utf8);
92 bool WideToUTF8(const std::wstring& utf16, std::string* utf8) {
95 return WideToUTF8(utf16.c_str(), utf16.length(), utf8);
99 static bool UTF8ToWideWithFlags(const char* utf8, const size_t size, std::wstring* utf16,
109 const int chars_required = MultiByteToWideChar(CP_UTF8, flags, utf8, size,
119 const int result = MultiByteToWideChar(CP_UTF8, flags, utf8, size,
132 bool UTF8ToWide(const char* utf8, const size_t size, std::wstring* utf16) {
134 if (UTF8ToWideWithFlags(utf8, size, utf16, MB_ERR_INVALID_CHARS)) {
142 (void)UTF8ToWideWithFlags(utf8, size, utf16, 0);
147 bool UTF8ToWide(const char* utf8, std::wstring* utf16) {
149 return UTF8ToWide(utf8, strlen(utf8), utf16);
152 bool UTF8ToWide(const std::string& utf8, std::wstring* utf16) {
155 return UTF8ToWide(utf8.c_str(), utf8.length(), utf16);
162 bool UTF8PathToWindowsLongPath(const char* utf8, std::wstring* utf16) {
163 if (!UTF8ToWide(utf8, utf16)) {
182 namespace utf8 {
233 } // namespace utf8