]> git.lizzy.rs Git - minetest.git/commitdiff
Android: bypass broken wide_to_utf8 with wide_to_narrow (again)
authorest31 <MTest31@outlook.com>
Sun, 14 Jun 2015 04:38:02 +0000 (06:38 +0200)
committerest31 <MTest31@outlook.com>
Wed, 19 Aug 2015 16:38:00 +0000 (18:38 +0200)
This bypass had to be re-enabled as some users reported issues,
even after the iconv build fix.

While utf8_to_wide works well, wide_to_utf8 is quite broken
on android, for some reason, and some devices (unrelated from build
configuration).

src/util/string.cpp

index 6d1eda078025d8aefc9e00dcf0091fa6bc1c3082..c2724aa58acd81a7ed58c782f31e9e2877a22609 100644 (file)
@@ -102,6 +102,13 @@ std::wstring utf8_to_wide(const std::string &input)
        return out;
 }
 
+#ifdef __ANDROID__
+// TODO: this is an ugly fix for wide_to_utf8 somehow not working on android
+std::string wide_to_utf8(const std::wstring &input)
+{
+       return wide_to_narrow(input);
+}
+#else
 std::string wide_to_utf8(const std::wstring &input)
 {
        size_t inbuf_size = (input.length() + 1) * sizeof(wchar_t);
@@ -128,6 +135,7 @@ std::string wide_to_utf8(const std::wstring &input)
        return out;
 }
 
+#endif
 #else // _WIN32
 
 std::wstring utf8_to_wide(const std::string &input)