Из документов NDK r5b / STANDALONE-TOOLCHAIN.html:
5.2/ wchar_t support:
- - - - - - - - - - -
As documented, the Android platform did not really support wchar_t until
Android 2.3. What this means in practical terms is that:
- If you target platform android-9 or higher, the size of wchar_t is
4 bytes, and most wide-char functions are available in the C library
(with the exception of multi-byte encoding/decoding functions and
wsprintf/wsscanf).
- If you target any prior API level, the size of wchar_t will be 1 byte
and none of the wide-char functions will work anyway.
We recommend any developer to get rid of any dependencies on the wchar_t type
and switch to better representations. The support provided in Android is only
there to help you migrate existing code.
Поскольку вы ориентируетесь на Android 1.6, похоже, что wchar_t вам не подходит.
Даже на платформе Android 2.3 («android-9») все еще есть заметки в нескольких местах, включая wchar.h
, из которых следует, что wchar_t
- это один байт, и ни одна из функций библиотеки широких символов не является реализованы. Это говорит о том, что реализация все еще может быть хитрой, поэтому я буду очень осторожен с использованием wchar_t на любой версии Android.
Если вы ищете альтернативу, я считаю UTFCPP отличной и очень легкой библиотекой.