Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
est31 committed Aug 19, 2015
1 parent 1fadf7f commit 457d42c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/util/string.cpp
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit 457d42c

Please sign in to comment.