diff options
author | Jaromir Wysoglad | 2019-08-14 01:43:12 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-08-24 18:12:45 +0300 |
commit | 3e4b5c7d3b75c5ff59e68c29296b57ac2b7f607d (patch) | |
tree | 701fb723f35e50d74b20d8cdfb12c556e25a4976 /backends | |
parent | a0564bc564559abf87165331a42d22b89c998dce (diff) | |
download | scummvm-rg350-3e4b5c7d3b75c5ff59e68c29296b57ac2b7f607d.tar.gz scummvm-rg350-3e4b5c7d3b75c5ff59e68c29296b57ac2b7f607d.tar.bz2 scummvm-rg350-3e4b5c7d3b75c5ff59e68c29296b57ac2b7f607d.zip |
WIN32: Resolve endianity in convertEncoding()
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/sdl/win32/win32.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index e1f7964ab3..d3e8c4d1d5 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -392,6 +392,16 @@ char *OSystem_Win32::convertEncoding(const char* to, const char *from, const cha if (result != nullptr) return result; + // We accept only the machine endianness +#ifdef SCUMM_BIG_ENDIAN + if (Common::String(from).hasSuffixIgnoreCase("le") || + Common::String(to).hasSuffixIgnoreCase("le")) + return nullptr; +#else + if (Common::String(from).hasSuffixIgnoreCase("be") || + Common::String(to).hasSuffixIgnoreCase("be")) + return nullptr; +#endif // UTF-32 is really important for us, because it is used for the // transliteration in Common::Encoding and Win32 cannot convert it if (Common::String(from).hasPrefixIgnoreCase("utf-32")) { |