views:

944

answers:

3

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?

+4  A: 
vartec
This works but hex is a part of unicode, so I'll use the second method.
Mikle
Would you care to elaborate on that?
vartec
Your life will be a lot easier if you limit your HTML text to 7-bit ASCII. If you use an 8-bit encoding, you have to ensure that your webserver inserts the correct response parameter to identify that encoding. And chances are good that someone, somewhere, will screw up.
kdgregory
Of course that has it's advantages and it's disadvantages. But then again, UTF-8 is the current standard and all RFCs recommend using it. We shouldn't stay in 1960's just because someone might screw up.
vartec
@kdgregory I'm not going to do 7-bit ASCII just cause it is easy... The rest of the world exists (and I'm part of it) and I'm not going to ignore it.
Mikle
+6  A: 

Entities need a semi-colon:

©

Firefox is being incorrectly over-helpful in this case.

kdgregory
Well, it seems like a stupid requirement, since it's not a common phrase ("Hello my friend !"), why does it HAVE to look for ;? Seems like unnecessary complexity.
Mikle
It's part of the html recommendation, and the html recommendation prefers completeness (leading to simpler parsers) over assumptions. The irony here is that you assumed IE was at fault, when it was in fact IE that was strictly adhering to the "standard". ;-)
Rahul
I agree that this is somewhat ironic... I read a lot about browser compatibilities, and how IE sucks and the whole strict VS loose parsing issues, and lo and behold - less than 3 hours into my first web project (I did mostly desktop programming) I get bit by it...
Mikle
+2  A: 

Can't you use "©" ?

This page has a list of HTML codes for common symbols.

Jimmy J
@Jimmy you can insert literal HTML as code.
vartec