简体   繁体   English

Android NDK不支持std :: locale()?

[英]Android NDK doesn't support std::locale()?

I use std::local() to MBS to WCS in Android NDK. 我在Android NDK中使用std :: local()将MBS转换为WCS。

But... 但...

std::locale::global(std::locale("kor"))
std::locale::global(std::locale("ko"))
std::locale::global(std::locale("ko_KR"))
std::locale::global(std::locale("ko_KR.eucKr"))
std::locale::global(std::locale("ko_KR.euckr"))
std::locale::global(std::locale("ko_KR.EUCKR"))

All lead to crashes. 所有导致崩溃。

and... std::locale::global(std::locale("en_US.UTF-8")) also crashes. 和... std::locale::global(std::locale("en_US.UTF-8"))也崩溃。

Is std::locale() not supported in Android NDK? Android NDK不支持std::locale()吗?

My STL library is 我的STL库是

According to this the answer is No. 根据这个答案是否定的

There is no support for locales in the C library / from native code, and this is intentional. C库/本机代码不支持语言环境,这是有意的。 As Elliot pointed out, your only hope is to use JNI to get relevant values. 正如Elliot指出的那样,您唯一的希望是使用JNI获得相关的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM