Handling quotes is difficult

One of the biggest problems in scripting and programming is escaping quotes. Quotes have a special meaning, they are usually used for specifying the start and end of a string, such as in <abbr title="eXtensible Markup Language">. But what happens when the string between the quotes also contains quotes? …Errors!

There are several ways to prevent this situation. The two most common solutions are escaping the quotes by placing a special symbol in front of it such as " and replacing the quote by its character entity reference &quote;.

Why am I telling this? Well, this morning I was looking at Technorati’s Favorites function, and noticed that something went wrong. When adding a site to your favorites, you have the posibility to attach tags to that site. The instructions for adding tags are clear:

Separate tags with spaces: cooking indian recipes. To join words use double quotes: "san francisco".

But it doesn’t work that way! When I tried to add “point of sale” as a tag
Technorati tags

The following happened:
Technorati tags

Technorati obviously tried to solve the quoting problem by replacing the quotes, but this change has a nasty side effect. Of course I have contacted Technorati about this issue, and will update this post when they reply.

Jeroen Sangers @jeroensangers