Home | History | Annotate | Download | only in base

Lines Matching refs:utf16

44 bool WideToUTF8(const wchar_t* utf16, const size_t size, std::string* utf8) {
63 const int chars_required = WideCharToMultiByte(CP_UTF8, flags, utf16, size,
73 const int result = WideCharToMultiByte(CP_UTF8, flags, utf16, size,
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,
101 utf16->clear();
117 utf16->resize(chars_required);
120 &(*utf16)[0], chars_required);
125 utf16->clear();
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)) {
168 if (utf16->length() >= 248) {
170 if (isDriveLetter((*utf16)[0]) && (*utf16)[1] == L':' &&
171 ((*utf16)[2] == L'\\' || (*utf16)[2] == L'/')) {
174 utf16->insert(0, LR"(\\?\)");
175 std::replace(utf16->begin(), utf16->end(), L'/', L'\\');