Non Windows - specific conversion ANSI to UTF-8
| 225 | #if 0 |
| 226 | /// Non Windows - specific conversion ANSI to UTF-8 |
| 227 | char* ANSItoUTF8(const char* ansi) |
| 228 | { |
| 229 | if (ansi == nullptr) return nullptr; |
| 230 | |
| 231 | // Non-Windows-specific conversion |
| 232 | std::wstring_convert<std::codecvt_utf8<wchar_t>> converter; |
| 233 | std::wstring utf16 = converter.from_bytes(ansi); |
| 234 | size_t len = utf16.length() + 1; |
| 235 | |
| 236 | char* utf8 = new char[len]; |
| 237 | std::wcstombs(utf8, utf16.c_str(), len); |
| 238 | |
| 239 | return utf8; |
| 240 | } |
| 241 | #endif |
| 242 | |
| 243 | /// Opens a file with the specified filename and mode, converting filename and mode to UTF-16 on Windows. |