Reputation: 878
I have some .html with the font defined as:
<font color="white" face="Arial">
I have no other style applied to my
tag. In it, when I display data like:
<b> “Software” </b>
or
<b>“Software”</b>
they both display characters I do not want in the UIWebView. It looks like this on a black background:
How do I avoid that? If I don't use font face="arial"
, it works fine.
Upvotes: 0
Views: 617
Reputation: 47094
This is an encoding issue. Make sure you use the same encoding everywhere. UTF8 is probably the best choice.
You can put a line
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
in your html to tell UIWebView
about the encoding.
To be precise, “
is what you get when you take the UTF-8
encoding of “
, and interpret it as ISO-8859-1
. So your data is encoded in UTF-8
, which is good, and you just need to set the content type to UTF-8
instead of ISO-8859-1
(e.g. using the <meta>
tag above)
Upvotes: 1
Reputation: 57139
You shouldn’t generally use the curly quote characters themselves—character encodings will always mess you up somehow. No idea why it works correctly when you don’t use Arial (though that suggests a great idea: don’t use Arial), but your best bet is to use the HTML entities “
and ”
instead.
Upvotes: 0