Re:A popular but wrong way to convert a string to uppercase ...
by gpderetta on Tuesday October 08, 2024 @03:53PM
(#41781165)
Java ended up picking UCS-2 and getting screwed.
[ Parent
| on HN ]
Re:A popular but wrong way to convert a string to uppercase ...
by throwaway2037 on Wednesday October 09, 2024 @05:53AM
(#41786098)
Pretty much all Unicode early adopters went for 16-bit chars. Qt and Win32 API are another pair.
Re:A popular but wrong way to convert a string to uppercase ...
by gpderetta on Wednesday October 09, 2024 @08:21AM
(#41787089)
Indeed, 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.
Re:A popular but wrong way to convert a string to uppercase ...
by account42 on Wednesday October 09, 2024 @10:13AM
(#41788200)
Qt really has no excuse for still using 16-bit characters since unlike the other two they have had multiple ABI breaks since then.
Re:A popular but wrong way to convert a string to uppercase ...
by throwaway2037 on Thursday October 10, 2024 @03:37AM
(#41796512)
"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?".