logoalt Hacker News

octoberfranklin • today at 1:19 AM • 2 replies • view on HN

It's the facts, man.

If you want to say that the facts are dumb, well, you can do that.


Replies

gnabgib • today at 1:22 AM

No, it's not. UTF-16 supports the same characters as UTF-32 and UTF-8 (all three support all of Unicode). UTF-16 does that by having... variable width characters, in the form of 2-UTF16 code units for some chars.

UTF-16 wastes a bunch of space (when you don't need 16 bits to mark a character), and doesn't avoid variable-width encoding. UTF-8 tries to optimize space (but is ASCII skewed) with more variance (but once you can't infer length from bytes, what's the difference?) UTF-32 is a space hog at the benefit of predictable length encoding (a full Int32 to represent the null char, or a carriage return)

➕ show 1 reply
tialaramex • today at 2:10 AM

The insistence that Javascript means UCS-2 not UTF-16 involves selectively reading a version of the standards document that's more than a decade obsolete.

If you don't like facts that is dumb.