我有一个大的C/C++库,我需要使用它作为Android NDK项目的一部分。这个库需要能够智能地处理UTF8字符串(例如,转换为小写/大写)。android中的unicode支持ndk
该库具有条件编译来启动OS API以进行转换,但似乎没有任何适用于UTF8的Android API。 (mbstowcs等)
This thread说使用JNI方法来做到这一点(!),这是一个相当重的解决方案。
我在想构建ICU,但是因为它使用GNU Autotools我不确定我可以使它与NDK工具链一起工作。 :/
有没有其他人遇到过这个问题,并且使用JNI以外的其他方法?
编辑:我试图让ICU编译失败在配置阶段:
checking wchar.h usability... no
checking wchar.h presence... yes
configure: WARNING: wchar.h: present but cannot be compiled
configure: WARNING: wchar.h: check for missing prerequisite headers?
configure: WARNING: wchar.h: see the Autoconf documentation
configure: WARNING: wchar.h: section "Present But Cannot Be Compiled"
configure: WARNING: wchar.h: proceeding with the preprocessor's result
configure: WARNING: wchar.h: in the future, the compiler will take precedence
checking for wchar.h... yes
checking for library containing wcscpy... none required
checking size of wchar_t... 0
configure: error: There is wchar.h but the size of wchar_t is 0
你有没有得到这个工作? – tofutim 2012-02-09 17:54:00
@ tofutim不,但我还没有能够重新访问它。 – paleozogt 2012-02-13 16:10:22
正好碰到这个问题。 – tofutim 2012-03-19 22:42:32