IE7 And '

Written by Tuesday, 08 April 2008
Rate this item
(0 votes)

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

5 comments

  • Comment Link Ralph Lauren Outlet Online Thursday, 05 January 2012 posted by Ralph Lauren Outlet Online

    Ugg boots are more suitable for slim trim determine for Asians and foot, furthermore, with the EVA and rubber new hybrid bionic finish,

  • Comment Link mitch Wednesday, 23 September 2009 posted by mitch

    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..http://mitchwilson.net/2009/08/28/new-macbook-pro-laptop/">New Macbook Pro laptop =-.

  • Comment Link RahulD Monday, 09 March 2009 posted by RahulD

    use ’

  • Comment Link Rob Tuesday, 17 February 2009 posted by Rob

    use '

  • Comment Link Patrice Levesque Wednesday, 09 April 2008 posted by Patrice Levesque

    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!) :)

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.