& a p o s ; in IE

Filed Under (Web Design and Development) by admin on 30-09-2008

Does not work. At the time of this writing, Internet Explorer 7 does (still) not expand XML-based character entities, such as ', <, > or ".

That may seem fairly obvious and perhaps even normal to the XML mavens out there, but I still keep forgetting from time to time that some web browsers may neither be able, willing nor ready to interpret those “friendly” charcter entities.

  • Instead of using ' (apostrophe) in your XHTML markup, use: '
  • Instead of using " (quotes) in your XHTML markup, use: "
  • Instead of using > (greater than) in your XHTML markup, use: >
  • Instead of using < (less than) in your XHTML markup, use: <

For situations in which you receive an RSS feed or other XML-based content, it would be best to replace the “friendly” character entities with escaped characters or the decimal character entities I’ve listed above.

In PHP, for example, you would do something like this:
$text = str_replace(’'’, ‘\”, $text);

In ASP, for example, you would do something like this:
text = replace(text, “'”, “'”)

Let me know if you have any additional insights into this subject. Thanks!

Post a comment

Add to Technorati Favorites

My BlogCatalog BlogRank