为什么以下代码会导致我的Android应用崩溃?
new String("é".getBytes(StandardCharsets.UTF_8), "UTF8")
Run Code Online (Sandbox Code Playgroud)
或者干脆
new String("é".getBytes())
Run Code Online (Sandbox Code Playgroud)
这该怎么做?
一些信息:
错误:
08-18 20:30:04.877 18914-18924/com.nextwebart.senego W/google-breakpad:### ### ### ### ### ### ### ### ### ### ### ### ### 08-18 20:30:04.877 18914-18924/com.nextwebart.senego W/google-breakpad:Chrome构建指纹:08-18 20:30:04.877 18914-18924 /com.nextwebart.senego W/google-breakpad:4.2.8 08-18 20:30:04.877 18914-18924/com.nextwebart.senego W/google-breakpad:70 08-18 20:30:04.877 18914-18924 /com.nextwebart.senego W/google-breakpad:### ### ### ### ### ### ### ### ### ### ### ### ## #08-18 20:30:04.877 18914-18924/com.nextwebart.senego A/libc:致命信号11(SIGSEGV),代码1,故障地址0x5 in tid 18924(JDWP)
相关问题在这里:Java字符串字符编码 - 法语 - 荷兰语语言环境
-------编辑:
它只发生在我的Android Studio调试器中!所以当我用它作为手表或"评估表达"时.但是当我在代码中执行此操作然后Log.d(...)它工作正常!Android Studio 2.1.3
我为此创建了Android Studio问题:https://code.google.com/p/android/issues/detail?id = 220366
new String("\xc3\xa9".getBytes())\nRun Code Online (Sandbox Code Playgroud)\n\n它非常适合我。我已经使用 android min API 14 对其进行了测试。\n请检查,可能会出现任何其他问题。
\n| 归档时间: |
|
| 查看次数: |
511 次 |
| 最近记录: |