2013-03-11 103 views
0

我有一個strings.xml文件,包含我所有的應用程序字符串,我有一些像€這樣的simbols,並且我遇到了麻煩。字符串編碼,移動編碼

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <string name="currency"> € </string> 
</resources></resources> 

通常他們顯示正常,但並不適用於所有設備:

enter image description here

我怎麼能自動檢測設備的配置?

回答

1

我發現這個問題,在Java類我:

webCost.loadData(cost, "text/html", null); 

它應該是:

webAbout.loadDataWithBaseURL(null, aboutStr, "text/html","utf-8", null); 
1

您應該使用貨幣符號的Unicode字符。

所以不是

<string name="currency"> € </string> 

使用這一個

<string name="pound">\u00a3</string> 
<string name="euro">\u20ac</string> 

這將UNI正式在所有的設備看起來一樣。 這一定會解決你的問題。