开发者

u16string and char16_t in Android NDK

开发者 https://www.devze.com 2023-02-22 04:54 出处:网络
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 LOC

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, 开发者_Go百科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;

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消