Android 字符串编码,移动编码
我有一个strings.xml文件和我所有的应用程序字符串,我有一些类似€的simbol,我在使用它们时遇到了麻烦Android 字符串编码,移动编码,android,Android,我有一个strings.xml文件和我所有的应用程序字符串,我有一些类似€的simbol,我在使用它们时遇到了麻烦 <?xml version="1.0" encoding="utf-8"?> <resources> <string name="currency"> € </string> </resources></resources> € 它们通常显示良好,但并非在所有设备中都显示: 如何自动检测设备
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="currency"> € </string>
</resources></resources>
€
它们通常显示良好,但并非在所有设备中都显示:
如何自动检测设备中的配置?您可以为不同语言创建字符串文件。请阅读“”。您可以为不同语言创建字符串文件。请阅读“”。您应该使用Unicode字符作为货币符号 所以不是
<string name="currency"> € </string>
€
用这个
<string name="pound">\u00a3</string>
<string name="euro">\u20ac</string>
\u00a3
\u20ac
这将在所有设备上看起来都一样。
这肯定会解决您的问题。您应该使用Unicode字符作为货币符号 所以不是
<string name="currency"> € </string>
€
用这个
<string name="pound">\u00a3</string>
<string name="euro">\u20ac</string>
\u00a3
\u20ac
这将在所有设备上看起来都一样。
这肯定会解决您的问题。我在java类中发现了问题:
webCost.loadData(cost, "text/html", null);
它应该是:
webAbout.loadDataWithBaseURL(null, aboutStr, "text/html","utf-8", null);
我在java类中发现了问题:
webCost.loadData(cost, "text/html", null);
它应该是:
webAbout.loadDataWithBaseURL(null, aboutStr, "text/html","utf-8", null);