4 ms·
Java ended up picking UCS-2 and getting screwed.
by gpderetta 2y ago
Java ended up picking UCS-2 and getting screwed.
- throwaway2037 2y agoPretty much all Unicode early adopters went for 16-bit chars. Qt and Win32 API are another pair.
- gpderetta 2y agoIndeed, ICU as well, and then they all moved to UTF-16, which, again. in the long term lost to UTF-8. My point is that committing on a specific Unicode design 30 years ago was not, in retrospect, necessarily a good idea. By not committing to UCS-2 early C++ left the road open to UTF-8. I'll concede that UTF8 has risen as the clear winner for more than a decade and C++ is well past the point that it should have at least basic builtin support. The problem is that there is at least one important C++ platform that only very recently added full support for the encoding in their native API.
- account42 2y agoQt really has no excuse for still using 16-bit characters since unlike the other two they have had multiple ABI breaks since then.
- throwaway2037 2y ago"no excuse" -- I would respectfully disagree here. There are lots of very smart people who have worked on Qt. Really, some insanely good C++ programmers have worked on that project. I have no doubt that they have discussed changing class QString to use UTF-8 internally. To be clear, probably QChar would also need to change, or a new class (QChar8?) would be needed, in parallel to QChar. I guess they concluded the API breakage would be too severe. I assume Java and Win32/DotNet decided the same. Finally, you can Google for old mailing list discussions about QString using UTF-16. Many before have asked "can we just change to UTF-8?".
- account42 2y agoAh yes, appeal to authority. No better way to admit that you are talking out of your arse.