问题描述
我试图解决一个Cocos2d-x键盘输入崩溃在Android 5.x当我创建CCImage从文本与许多表情符号发现在键盘上(一些工作,但大多数不。)在Android 4。 x几个设备只是显示复杂的文本/额外的字符。崩溃的源是JNI的NewStringUTF()调用。它不支持Android 5 / Lollipop中的所有2,3和4字节utf-8字符。这种崩溃发生在cocos2d-x v2.2.6并确认在3.x)使用NDK 10e与工具链4.8(不知道如果任何一个,这是太大的区别,我们使用9d之前移动到Android Studio,我确定我们有这个问题,但有很多
如果你从未推送任何未修改的utf-8符号(即坚持ascii),你可能永远不会看到这个问题。 / p>
日志猫:
12-11 01:02:17.460 10451-10959 / com.appsomniacs.da2.debug A / art:sart / runtime / check_jni.cc:65] string:'I am trying to solve a Cocos2d-x Keyboard input crash on Android 5.x when I create CCImage from the text with many emoji found on the keyboard (some work though, but most don't.) On Android 4.x several of the devices just display mangled text/extra characters. The source of the crash is the JNI's NewStringUTF() call. It simply does not support all of the 2, 3 and 4 byte utf-8 characters in Android 5/Lollipop.
This crash happens on cocos2d-x v2.2.6 (and confirmed on 3.x) using NDK 10e with Toolchain 4.8 (not sure if any of that makes too much of a difference, we were using 9d prior to moving to Android Studio and I am certain we had this issue, but there was much less usage to lollipop.)
If you never push any of non-modified utf-8 symbols (i.e. stick to ascii) you'll probably never see the issue.
Log Cat: 12-11 01:02:17.460 10451-10959/com.appsomniacs.da2.debug A/art: sart/runtime/check_jni.cc:65] string: ' 这篇关于调用C ++ JNI NewStringUTF崩溃android应用程序时,使用许多不同种类的表情符号和语言(超越ascii,但仍然有效修改utf-8)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!