Re:UTF-8 – "The most elegant hack"
by shadowmatter on Saturday September 28, 2013 @08:53PM
(#6463665)
From http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Ch...: "The native character encoding of the Java programming language is UTF-16."
That said, at least they adopted a Unicode encoding, and helped it establish mindshare.
Is this right? Doesn't Java use UTF-16 internally?
And Java's first attempt to implement UTF-8, the one they called "UTF8", is not UTF-8. It's almost but not quite CESU-8. It will probably fuck up your astral characters (like emoji).
The real Java UTF-8 is, intuitively, named "AL32UTF8".
Re:UTF-8 – "The most elegant hack"
by davidgerard on Sunday September 29, 2013 @04:45PM
(#6466455)
And then there's the unremitting horror that MySQL calls UTF-8, properly known as WTF-8.
I'd want to save the name "WTF-8" for that case where someone takes some text encoded as UTF-8, decodes it as if it's in a single-byte encoding, and then encodes the resulting mojibake as UTF-8 again.
Double UTF-8. WTF-8.
(Yes, UTF-8 hack is nothing compared to Huffman coding. The Deflate compression algorithm using Huffman coding to encode the LZ77 output and the Huffman encoding table itself is another notch up on the hacking coolness scale.)