I know that JavaScript strings are usually encoded with an encoding taking at least two bytes per character (UTF-16 or UCS-2).
However, when constructing a Blob, a different encoding appears to be used because when I read it as ArrayBuffer
, the length of the returned buffer is 3 for an Euro sign.
var b = new Blob(['€']);
According to the W3C, it is UTF-8 encoded.
Demo:
Play with that on JSFiddle.