user1256477
user1256477

Reputation: 11201

string encoding, mobile encoding

I have a strings.xml file with all my app string, I have some simbols like €, and I having trouble with them.

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

They usually shows fine, but not in all devices:

enter image description here

How can I auto-detect the configuration in the device?

Upvotes: 0

Views: 135

Answers (3)

Amit Gupta
Amit Gupta

Reputation: 8939

You should use Unicode Character for Currency symbol.

so instead of

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

use this one

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

This will uni formally look same in all the devices. This will surely solve your issue.

Upvotes: 1

user1256477
user1256477

Reputation: 11201

I found the problem, in the java class I had:

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

And it should be:

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

Upvotes: 1

Yangfan
Yangfan

Reputation: 1876

You can create string files for different languages. Please read "Supporting Different Languages".

Upvotes: 1

Related Questions