Remix.run Logo
zzo38computer a day ago

You can do better than "only ASCII works in this device", and making the default string type to be Unicode is the wrong way to do that. For some applications, you might not need to interpret text at all, or you might need to only interpret ASCII text even if the text is not necessarily purely ASCII; other times you will want to do other things, but Unicode is not a very good character set (there are others but what is appropriate will depend much on the specific application in use; sometimes none are appropriate), and even if you are using Unicode you still don't need a Unicode string type, and you do not need it to check for valid UTF-8 for every string operation by default, because that will result in inefficiency.

tialaramex 19 hours ago | parent [-]

In 1995 what you describe isn't crazy. Who knows if this "Unicode" will go anywhere.

In 2005 it's rather old-fashioned. There's lots of 8859-1 and cp1252 out there but people aren't making so much of it, and Unicode aka 10646 is clearly the future.

In 2015 it's a done deal.

Here we are in 2025. Stop treating non-Unicode text as anything other than an aberration.

You don't need checks "for every string operation". You need a properly designed string type.