What is the standard algorithm for converting unicode characters into lowercase?
I want to know the standard algorithm for converting unicode characters into lowerca开发者_JAVA百科se as proposed by unicode.org.
Also, do most programming languages follow this proposed standard?
I want to know the standard algorithm for converting unicode characters into lowercase as proposed by unicode.org.
The basic algorithm is simply to concatenate the lowercase of each individual character (as defined by the penultimate column in UnicodeData.txt). There are also some special rules to handle multiple-character mappings (İ → i̇ with an extra COMBINING DOT ABOVE the i), conditional mappings (Σ → ς at the end of a word, but σ otherwise), and language-sensitive rules (like Turkish dotless ı).
Also, do most programming languages follow this proposed standard?
Java does. Python implements the basic rules, but not the special rules. And C has no standardized Unicode support at all.
.NET does have unicode support and offers built-in functions to switch between upper and lower case. This is probably true with some other languages, as well.
Programming languages vary in how well they support unicode. Most do not have unicode characters as a built-in type. Typically it is either handled in a library, or by OS calls.
For instance, C++ doesn't have a native unicode character type, but does have locale support in the stl (which is defined as part of the language). Ada does have a native type Wide_Character, as well as library support for manipulating it.
精彩评论