3 ms·
I wasn't, but thanks anyway ;-) I think Java uses UTF-16 and all those years as a Java developer I was under the impression that it can only use two bytes per "
by Tichy 17y ago
I wasn't, but thanks anyway ;-) I think Java uses UTF-16 and all those years as a Java developer I was under the impression that it can only use two bytes per "letter". Thanks for the clarification.
It's significant because it messes up the length (or size) property of strings, doesn't it?
- sp332 17y agoYeah, big-time. Guaranteed fixed-size encodings either take 4 bytes per codepoint, or give up some codepoints as unencodeable.
- dionidium 17y agoYou were probably under that impression because it used to be true. Java started supporting surrogate pairs -- i.e. it made the switch from UCS-2 to UTF-16 -- in J2SE 5.0 http://en.wikipedia.org/wiki/UTF-16#Use_in_major_operating_systems_and_environments http://en.wikipedia.org/wiki/UTF-16#Use_in_major_operating_s...