u16string和char16_t在Android的NDK [英] u16string and char16_t in Android NDK

查看:1402
本文介绍了u16string和char16_t在Android的NDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建(的std ::函数getline()),并操纵在Android NDK UTF-16字符串,这样我就可以通过他们的(相对)怕疼回对Java进行显示。目前,我使用C ++ 0x中,使用 LOCAL_CPPFLAGS:= = -std的C ++ 0x 开关,它的工作原理(我使用一些其他的功能0X) 。看来编译器找不到 u16string 。我已经包括<串GT; ,并没有得到其他错误。我希望做一些事情,如:

I wish to create (std::getline()) and manipulate UTF-16 strings in the Android NDK, so that I can pass them (relatively) painlessly back to Java for display. Currently, I'm using C++0x, using the LOCAL_CPPFLAGS := -std=c++0x switch, which works (I'm using some other 0x functions). Seems the compiler can't find u16string. I've included <string>, and get no other errors. I wish to do something such as:


ifstream file(fileName);
if(!file.is_open()) {
    return false;
}
while(!file.eof()) {
    u16string fileLine;
    std::getline(file, fileLine);

    // Do stuff with fileLine
}
return true;

在NDK是否包括了过期的版本的GCC之类的东西?我应该怎么办?

Does the NDK include an out-of-date version of GCC or something? What should I do?

推荐答案

NDK的不(至少没有正式)支持宽字符,UTF-16或类似的东西。它也没有提供适当的C ++库。

The NDK does not (at least not officially) support wide characters, UTF-16 or anything like that. Nor does it provide a proper C++ library.

这篇关于u16string和char16_t在Android的NDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆