• Home
  • Raw
  • Download

Lines Matching refs:utf16

44 bool WideToUTF8(const wchar_t* utf16, const size_t size, std::string* utf8) {  in WideToUTF8()  argument
63 const int chars_required = WideCharToMultiByte(CP_UTF8, flags, utf16, size, in WideToUTF8()
73 const int result = WideCharToMultiByte(CP_UTF8, flags, utf16, size, in WideToUTF8()
87 bool WideToUTF8(const wchar_t* utf16, std::string* utf8) { in WideToUTF8() argument
89 return WideToUTF8(utf16, wcslen(utf16), utf8); in WideToUTF8()
92 bool WideToUTF8(const std::wstring& utf16, std::string* utf8) { in WideToUTF8() argument
95 return WideToUTF8(utf16.c_str(), utf16.length(), utf8); in WideToUTF8()
99 static bool UTF8ToWideWithFlags(const char* utf8, const size_t size, std::wstring* utf16, in UTF8ToWideWithFlags() argument
101 utf16->clear(); in UTF8ToWideWithFlags()
117 utf16->resize(chars_required); in UTF8ToWideWithFlags()
120 &(*utf16)[0], chars_required); in UTF8ToWideWithFlags()
125 utf16->clear(); in UTF8ToWideWithFlags()
132 bool UTF8ToWide(const char* utf8, const size_t size, std::wstring* utf16) { in UTF8ToWide() argument
134 if (UTF8ToWideWithFlags(utf8, size, utf16, MB_ERR_INVALID_CHARS)) { in UTF8ToWide()
142 (void)UTF8ToWideWithFlags(utf8, size, utf16, 0); in UTF8ToWide()
147 bool UTF8ToWide(const char* utf8, std::wstring* utf16) { in UTF8ToWide() argument
149 return UTF8ToWide(utf8, strlen(utf8), utf16); in UTF8ToWide()
152 bool UTF8ToWide(const std::string& utf8, std::wstring* utf16) { in UTF8ToWide() argument
155 return UTF8ToWide(utf8.c_str(), utf8.length(), utf16); in UTF8ToWide()
162 bool UTF8PathToWindowsLongPath(const char* utf8, std::wstring* utf16) { in UTF8PathToWindowsLongPath() argument
163 if (!UTF8ToWide(utf8, utf16)) { in UTF8PathToWindowsLongPath()
168 if (utf16->length() >= 248) { in UTF8PathToWindowsLongPath()
170 if (isDriveLetter((*utf16)[0]) && (*utf16)[1] == L':' && in UTF8PathToWindowsLongPath()
171 ((*utf16)[2] == L'\\' || (*utf16)[2] == L'/')) { in UTF8PathToWindowsLongPath()
174 utf16->insert(0, LR"(\\?\)"); in UTF8PathToWindowsLongPath()
175 std::replace(utf16->begin(), utf16->end(), L'/', L'\\'); in UTF8PathToWindowsLongPath()