| 166 | //----------------------------------------------------------------------- |
| 167 | #ifdef _OGRE_FILESYSTEM_ARCHIVE_UNICODE |
| 168 | static std::wstring to_wpath(const String& text, unsigned codepage = CP_UTF8) |
| 169 | { |
| 170 | const int utf16Length = ::MultiByteToWideChar(codepage, 0, text.c_str(), (int)text.size(), NULL, 0); |
| 171 | if(utf16Length > 0) |
| 172 | { |
| 173 | std::wstring wt; |
| 174 | wt.resize(utf16Length); |
| 175 | if(0 != ::MultiByteToWideChar(codepage, 0, text.c_str(), (int)text.size(), &wt[0], (int)wt.size())) |
| 176 | return wt; |
| 177 | } |
| 178 | return L""; |
| 179 | } |
| 180 | static String from_wpath(const std::wstring& text, unsigned codepage = CP_UTF8) |
| 181 | { |
| 182 | const int length = ::WideCharToMultiByte(codepage, 0, text.c_str(), (int)text.size(), NULL, 0, NULL, NULL); |
no test coverage detected