My application reads data from a json file for translation. The french file contains accents. When string with accents are involved my application crash at runtime, when the text widget that contains accent is created.
Here the adb log:
10-13 09:33:40.173 25013-25027/com.test.jarold A/art: art/runtime/java\_vm\_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0 10-13 09:33:40.173 25013-25027/com.test.jarold A/art: art/runtime/java\_vm\_ext.cc:410] string: 'Acad�' 10-13 09:33:40.173 25013-25027/com.test.jarold A/art: art/runtime/java\_vm\_ext.cc:410] in call to NewStringUTF 10-13 09:33:40.173 25013-25027/com.test.jarold A/art: art/runtime/java\_vm\_ext.cc:410] from void com.ansca.corona.JavaToNativeShim.nativeRender(long)
I understand the NewStringUTF function needs a Modified UTF-8 string but i don’T think there is a way to make a conversion of my string.
I found out what is the issue, its with the string:sub() function, it doesn’t like accents
those two line generate the issue:
local str = "télé" local myText = display.newText( str:sub((1,2), 100, 100, native.systemFont, 15)
if you test this code in the simulator, it doesnt crash but you dont see the text, if you compile native with android, it gives the error i reported previously.
I wonder, is this a known issue or normal behavior?
and if it is normal, is there a sub() function that support accent or I need to find a workaround?
I need to know where to download the plugin.utf8 jar file in order to make the plugin works natively on Android. Can’t find a place to get it. Are those available somewhere?
We had a process that we didn’t want to post in the public forums, because it was not going to be our long term solution and people tend to find old posts, so we were keeping out of searchable areas. We want you to be able to do this.
Engineering was working on a more public solution. I’m assuming that’s what @Vlad posted above. I’ve been out of the office a lot lately so we may have okayed this for public consumption. I’ll talk with @Vlad about it.
I found out what is the issue, its with the string:sub() function, it doesn’t like accents
those two line generate the issue:
local str = "télé" local myText = display.newText( str:sub((1,2), 100, 100, native.systemFont, 15)
if you test this code in the simulator, it doesnt crash but you dont see the text, if you compile native with android, it gives the error i reported previously.
I wonder, is this a known issue or normal behavior?
and if it is normal, is there a sub() function that support accent or I need to find a workaround?
I need to know where to download the plugin.utf8 jar file in order to make the plugin works natively on Android. Can’t find a place to get it. Are those available somewhere?
We had a process that we didn’t want to post in the public forums, because it was not going to be our long term solution and people tend to find old posts, so we were keeping out of searchable areas. We want you to be able to do this.
Engineering was working on a more public solution. I’m assuming that’s what @Vlad posted above. I’ve been out of the office a lot lately so we may have okayed this for public consumption. I’ll talk with @Vlad about it.