Re:Code Page 437 Refuses to Die
by 0x0 on Sunday May 08, 2016 @11:10AM
(#11654341)
Absolutely, there's quite a few gaffes in java (other languages have similar issues too):
* char being 16bit and thus can't hold a modern unicode character
* lots and lots of string and byte stream methods that have variants without explicit charset parameters, making it very easy to accidentally have a hidden dependency on the implicit default charset (aka -Dfile.encoding)
* Using strings instead of byte[] for filename values
* Having to deal with UnsupportedEncodingExceptions as checked exceptions whenever referencing the UTF8 encoding
Re:Code Page 437 Refuses to Die
by jfim on Sunday May 08, 2016 @01:56PM
(#11654937)
The reason for char being 16 bits is that the JLS predates Unicode 2.0 (1996), which added 32 bit codepoints. At that time, UCS-2 was widely believed to be sufficient to represent anything "international."
* char being 16bit and thus can't hold a modern unicode character
* lots and lots of string and byte stream methods that have variants without explicit charset parameters, making it very easy to accidentally have a hidden dependency on the implicit default charset (aka -Dfile.encoding)
* Using strings instead of byte[] for filename values
* Having to deal with UnsupportedEncodingExceptions as checked exceptions whenever referencing the UTF8 encoding