IE7 And '

Well, I learned something today.

The XML entity “'” is not displayed properly under IE7. Instead of showing the single quote, as I would expect, it shows “'”.

' works well under FireFox, IE6, IE5, Safari and Opera. But no longer under IE7.

The most understandable explanation I’ve found about this is that it is part of the XML standard and not HTML.

To which I would reply: yeah, but I’m doing XHTML.

To which I’ve read the insightful reply:

If you’re doing XHTML, the world is not ready for you.

Another hilarious and insightful answer to the problem was :

Use ‘ instead of ' ?

So I’m resting from the shock and looking at my HTML transformation libraries wondering if there is a tsunami of problems that is waiting for me if I remove the conversion from single quote to the ' entity.

I really don’t expect any troubles as we never used single quotes to delimit parameters within HTML and we never used the HTML transformation methods to send text to javascript.

Still, one wonders about the woodpeckers and civilization.

Maybe Microsoft will let out a patch?

LOL.

For once, it seems that it is MS that is sticking to the standards. Brave new world?

To clarify the standards:

&apos is not part of HTML: W3CCharacter entity references in HTML 4

But is a part of XHTML: W3C xhtml DTD entity set: Special characters

Here’s a link to an entity test, devised by W3C.

The whole issue is also described in Wikipedia – Entities representing special characters in XHTML

4 thoughts on “IE7 And '

  1. I started using only numeric entities a few years ago as Safari (or was it MacIE5?) had problems with some entities too, when receiving XHTML served as application/xhtml+xml.

    Happy to know that I can still rely on good’ol ampersand-hash-three-nine-semicolon after hell freezes over (MSIE leads in standards compliance, woah!) 🙂

  2. For UTF-8, I believe the correct HTML code is ' for the apostrophe character. In Unicode 8217 is the right closing quote, not the apostrophe character. 8216 is the opening single quote. This is in Unicode. Character 39 is also the apostrophe in Unicode as well as in UTF-8.

    .-= mitch´s last blog..New Macbook Pro laptop =-.

Comments are closed.