A caution on Spotlight searches and ampersands

Sep 25, '08 07:30:04AM

Contributed by: osxpounder

While working on HTML files, I often use a special character, the 'em-dash' (—). In HTML code, an em-dash is made using a numerical code that begins with an ampersand (&):

—
I wanted to search for all my HTML files containing that code, but Spotlight wouldn't find them if I typed in the whole code. If I left off the initial ampersand (#8212), Spotlight would find the entries. It seems to me that Spotlight can only find ampersands in certain cases, but which ones those are, I don't know yet.

So if you're looking for coded HTML entities in your files, try searching without the ampersand.

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20080923145959698