lower case of turkish character dotted i

前端 未结 1 448
面向向阳花
面向向阳花 2020-12-18 04:07

In Java 6,

System.out.println(String.valueOf(\'\\u0130\').toLowerCase());

prints i (u0069), but in Java 7 it prints i with dou

相关标签:
1条回答
  • 2020-12-18 04:30

    There is a quite detailed blog post about this i toLowerCase problem


    Let me try to summarize the essential parts:

    In Java 7 this method has indeed changed and handles this char differently than Java 6. The following code was added:

    } else if (srcChar == '\u0130') { // LATIN CAPITAL LETTER I DOT
        lowerChar = Character.ERROR;
    }
    

    ==> This change results in the following way:

    Basically the end result of this change is that for this specific case (the upper-case dotted I), Java 7 now consults a special Unicode character database (http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt), which provides data on complex case-mappings. Looking at this file you can see several lines for the upper-case dotted I:

    CODE       LOWER   TITLE   UPPER  LANGUAGE
    0130;  0069 0307;   0130;   0130;
    0130;  0069;        0130;   0130;       tr;
    0130;  0069;        0130;   0130;       az;
    
    0 讨论(0)
提交回复
热议问题