aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-29 20:26:53 +0200
committerFilippos Karapetis2019-08-24 18:12:45 +0300
commitbfdff38d01aae131cefb6d48e23d44b6ae2fa234 (patch)
tree3aff95e13803d145b47238b7227ca5290e1b25b3 /common
parentd6d6ac1823309b5a9ec05740442a8d7066fb8717 (diff)
downloadscummvm-rg350-bfdff38d01aae131cefb6d48e23d44b6ae2fa234.tar.gz
scummvm-rg350-bfdff38d01aae131cefb6d48e23d44b6ae2fa234.tar.bz2
scummvm-rg350-bfdff38d01aae131cefb6d48e23d44b6ae2fa234.zip
COMMON: Use backend specific encoding conversion
Diffstat (limited to 'common')
-rw-r--r--common/encoding.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/encoding.cpp b/common/encoding.cpp
index 43dce0420a..b2a704ca67 100644
--- a/common/encoding.cpp
+++ b/common/encoding.cpp
@@ -23,6 +23,7 @@
#include "common/encoding.h"
#include "common/debug.h"
#include "common/textconsole.h"
+#include "common/system.h"
#include <cerrno>
namespace Common {
@@ -79,6 +80,11 @@ char *Encoding::doConversion(iconv_t iconvHandle, const String &to, const String
#else
debug("Iconv is not available");
#endif // USE_ICONV
+ if (result == nullptr)
+ result = g_system->convertEncoding(to.c_str(), from.c_str(), string, length);
+
+ if (result == nullptr)
+ debug("Could not convert from %s to %s using backend specific conversion", from.c_str(), to.c_str());
return result;
}