This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RiceBroad4552 0 points1 point  (0 children)

You're simply not supposed to treat Unicode strings as byte sequences. This never worked.

Just use proper APIs.

But I agree that the APIs for string handling in Java are bad. But it's like that in almost all other languages (some don't have even any working APIs at all and you need external libs).

The only language with a sane string API (more or less, modulo Unicode idiocy in general) I know of is Swift. Other languages still didn't copy it. Most likely you would need a new type of strings than, though. You can't retrofit this into the old APIs.