I\'m using an \'&
\' symbol with HTML5 and UTF-8 in my site\'s
. Google shows the ampersand fine on its SERPs, as do all the browse
If you're really talking about the static text
Foo & Bar
stored in some file on the hard disk and served directly by a server, then yes: it probably doesn't need to be escaped.
However, since there is very little HTML content nowadays that's completely static, I'll add the following disclaimer that assumes that the HTML content is generated from some other source (database content, user input, web service call result, legacy API result, ...):
If you don't escape a simple &
, then chances are you also don't escape a &
or a
or or
or any other invalid text. That would mean that you are at best displaying your content wrongly and more likely are suspectible to XSS attacks.
In other words: when you're already checking and escaping the other more problematic cases, then there's almost no reason to leave the not-totally-broken-but-still-somewhat-fishy standalone-& unescaped.