summaryrefslogtreecommitdiff
path: root/src/util/string.cpp
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-06-14 06:38:02 +0200
committerest31 <MTest31@outlook.com>2015-08-19 18:38:00 +0200
commit457d42c5997cc430231ed221f06d8f4bba2100e7 (patch)
tree36484ff088247b037a8000c5ee19e41902ab9bed /src/util/string.cpp
parent1fadf7f21eb5fd7a09037d92f87cd0154e9306c1 (diff)
downloadminetest-457d42c5997cc430231ed221f06d8f4bba2100e7.tar.gz
minetest-457d42c5997cc430231ed221f06d8f4bba2100e7.tar.bz2
minetest-457d42c5997cc430231ed221f06d8f4bba2100e7.zip
Android: bypass broken wide_to_utf8 with wide_to_narrow (again)
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).
Diffstat (limited to 'src/util/string.cpp')
-rw-r--r--src/util/string.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/string.cpp b/src/util/string.cpp
index 6d1eda078..c2724aa58 100644
--- a/src/util/string.cpp
+++ b/src/util/string.cpp
@@ -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)