我使用的是 Eclipse,我没有这个问题:
IllegalDataException: Unable to serialize FindRecents state: The data "�" is not legal for a JDOM character content: Surrogate Pair Truncated.
我正在尝试复制一个特殊字符:🎧
当我复制它时,Android Studio 会输入:\uD83C\uDFA7
我已尝试将项目/文件编码设置为 utf-8,但这并没有改变任何内容,
如何在 Android Studio 中正确使用这个角色?
谢谢
最佳答案
您需要将表情符号的 Unicode 值显式转换为字符串。
您可以按如下方式轻松完成此操作:
//U+1F3A7 is the Unicode value of the Headphone emoji
int headPhoneEmoji = 0x1F3A7;
//Convert to string
String headPhoneString = new String(Character.toChars(headPhoneEmoji));
//Display it
myTextBox.setText(headPhoneString);
关于android - Android Studio 中的特殊符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34578038/