Most programming languages have some support for Unicode, but all have some more or less documented corner cases, where things won't work correctly.
Examples
Java: reverse() in StringBuilder/StringBuffer work correctly. But length(), charAt(), etc. in String do not if a character needs more than 16bit to encode.
C#: Didn't find a correct reverse method, Length and indexed access return wrong results.
Perl: Same problem.
PHP: Does not have an idea of Unicode at all, mbstring has some better working replacements.
I wonder if there is a programming language, which has full and correct Unicode support? What compromises had to be made there to achieve such a thing?
How was it implemented internally?
I saw that Python 3 had some pretty big changes in this area. How close is Python 3 now to a correct implementation?
The Java implementation is correct in the sense that is does not violate the Unicode standard; there is no prescription that string indexing work on code points instead of code units, and the behavior is documented. The Unicode standard gives implementors great freedom concerning optimizations as long as no invalid string is leaked. Concerning “full support”, that’s even harder to define. The Unicode standard generally doesn’t require that certain features be implemented to be Unicode-compatible; only that the features that are implemented are implemented according to the standard. Huge parts concerning script processing belong to fonts or the operating system, which programming systems cannot control. If you want to judge about the Unicode support of certain technologies, you can start by testing the following (subjective and non-exhaustive) list of topics:
UpperCase("ß") = "SS"
?UpperCase("i") = "İ"
)I think the Java and .NET answer to these questions is mostly “yes”, while the Python 3.x answer is almost always “no.”
Go, the new language developed at Google invented by Ken Thompson and Rob Pike and the C dialect in Plan9 from Bell Labs were built with Unicode in mind (UTF-8 was invented there, at Bell Labs, by Ken Thompson).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With