| 112 | //----------------------------------------------------------------------- |
| 113 | #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT |
| 114 | std::wstring to_wpath( const String &text, unsigned codepage = CP_UTF8 ) |
| 115 | { |
| 116 | const int utf16Length = |
| 117 | ::MultiByteToWideChar( codepage, 0, text.c_str(), (int)text.size(), NULL, 0 ); |
| 118 | if( utf16Length > 0 ) |
| 119 | { |
| 120 | std::wstring wt; |
| 121 | wt.resize( utf16Length ); |
| 122 | if( 0 != ::MultiByteToWideChar( codepage, 0, text.c_str(), (int)text.size(), &wt[0], |
| 123 | (int)wt.size() ) ) |
| 124 | { |
| 125 | return wt; |
| 126 | } |
| 127 | } |
| 128 | return L""; |
| 129 | } |
| 130 | String from_wpath( const std::wstring &text, unsigned codepage = CP_UTF8 ) |
| 131 | { |
| 132 | const int length = |
no test coverage detected