The Horror of the Entities

14 February 2002

This is pure HTML-geek stuff, so if you're not interested, skip down to the previous entry, which is a lot more silly.

Anyway, I was wondering why my apostrophes weren’t working with Movable Type (this very system for the blog). It isn’t that they wouldn’t show up correctly, but the XML syndication-thingy wasn’t working right through PHP. Hmmm... well, the best thing to do, I thought, was ignore it, and just use the stupid hash marks that everyone thinks are apostrophes, but really aren’t.

Can you see the difference between these two things?

1. A hash mark:   '  

2. An apostrophe (or single-right quote):   ’  

Well, I sure can. I hate hash marks, but I was using them anyway, because they were parsing better in the blog excerpt on my portal page.

But then, innocently, I was testing some of my pages for HTML and CSS compliance, and I found out, horrors of horrors, that I was using the wrong thing all along anyway. I’ve always been making my apostrophes by using ’, but this is very bad, apparently, and will eventually cause browsers to choke and rotate their heads 360° and all that. What I, and everyone else, should be using is ’. I never even knew that the HTML entities could even get that large. But, if you’re still reading this, and the only two people I know who would be are Keith and, maybe, Dan, the complete list is at http://www.cs.tut.fi/~jkorpela/html/guide/entities.html. Check it out, if you’re interested. It opened my eyes.

And thanks to A List Apart, without which, I would still be blind.

--JR

Posted by Jonathan at 08:25 PM, 14 February 2002

Comments

Aloha:

I just recently found out that the RIGHT SINGLE QUOTATION MARK or ’ is killing my XML files. Strange thing is that the error shows up as being â ?!?

I can't seem to find a way to make my PHP script that generates the XML file replace those entities with the single hash (which XML can handle).

Any ideas forming in your head that could help me?

Posted by: King Don at June 16, 2005 03:36 PM

Post a comment

  

  

Remember Me?