How to show Unicode characters in IE using HTML
-
21-08-2019 - |
Question
I'm trying to show the copyright and infinity signs at the bottom of my page using this code:
© Copyright Mikle 2009 - ∞
This works perfectly in Firefox 2, 3 and Chrome. IE7 though, is showing me the actual codes (like you see above) instead of what I expect and the other browser show:
© Copyright Mikle 2009 - ∞
This is probably some stupid thing, but this is making me understand why IE is getting so much hate. How do I fix this?
Solution
Entities need a semi-colon:
©
Firefox is being incorrectly over-helpful in this case.
OTHER TIPS
- Use decimal values.
- Always terminate entity with ; (semicolon) even in context, where it's optional.
- Use named entity whenever possible. Your example entities should be written
©
© and∞
∞
Other approach, is to forget about entities, and just put plain UTF-8 character there.
Can't you use "©
" ?
This page has a list of HTML codes for common symbols.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow