My name’s Mathias Bynens, and I’m a freelance web developer from Belgium. I collaborate on open-source projects such as jsPerf and HTML5 Boilerplate. If that sounds like fun to you, you should follow me on Twitter.
Does JavaScript use UCS-2 or UTF-16 encoding? Since I couldn’t find a definitive answer to this question anywhere, I decided to look into it. The answer depends on what you’re referring to: the JavaScript engine, or JavaScript at the language level.
In this post, we’ll take a closer look at what happens if there’s an unencoded ampersand that’s not part of a character reference in your HTML code. Is it valid? Is it invalid? And what do “ambiguous ampersands” have to do with all this?