Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show Unicode characters in IE using HTML

I'm trying to show the copyright and infinity signs at the bottom of my page using this code:

&#x00A9 Copyright Mikle 2009 - &#x221E

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?

like image 667
Mikle Avatar asked Mar 21 '09 12:03

Mikle


2 Answers

Entities need a semi-colon:

©

Firefox is being incorrectly over-helpful in this case.

like image 189
kdgregory Avatar answered Sep 20 '22 17:09

kdgregory


  1. Use decimal values.
  2. Always terminate entity with ; (semicolon) even in context, where it's optional.
  3. 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.

like image 29
vartec Avatar answered Sep 21 '22 17:09

vartec