Example #1
0
        // Only Azeri and Turkish have their own special cases.
        // Other than them, all languages have common special case
        // (enumerable enough).
        public virtual char ToLower(char c)
        {
            // quick ASCII range check
            if (c < 0x40 || 0x60 < c && c < 128)
            {
                return(c);
            }
            else if ('A' <= c && c <= 'Z' && (!handleDotI || c != 'I'))
            {
                return((char)(c + 0x20));
            }

            if (ci == null || ci.LCID == 0x7F)
            {
                return(CharUnicodeInfo.ToLowerInvariant(c));
            }

            switch (c)
            {
            case '\u0049':             // Latin uppercase I
                if (handleDotI)
                {
                    return('\u0131');                    // I becomes dotless i
                }
                break;

            case '\u0130':             // I-dotted
                return('\u0069');      // i

            case '\u01c5':             // LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
                return('\u01c6');

            // \u01c7 -> \u01c9 (LJ) : invariant
            case '\u01c8':             // LATIN CAPITAL LETTER L WITH SMALL LETTER J
                return('\u01c9');

            // \u01ca -> \u01cc (NJ) : invariant
            case '\u01cb':             // LATIN CAPITAL LETTER N WITH SMALL LETTER J
                return('\u01cc');

            // WITH CARON : invariant
            // WITH DIAERESIS AND * : invariant

            case '\u01f2':             // LATIN CAPITAL LETTER D WITH SMALL LETTER Z
                return('\u01f3');

            case '\u03d2':              // ? it is not in ICU
                return('\u03c5');

            case '\u03d3':              // ? it is not in ICU
                return('\u03cd');

            case '\u03d4':              // ? it is not in ICU
                return('\u03cb');
            }
            return(CharUnicodeInfo.ToLowerInvariant(c));
        }