UnicodeCaseMapping Class
Converts a text to uppercase or to lowercase, with the case mappings that depend on the context and on the language.
public static class UnicodeCaseMappingRemarks
The conversions are the full case conversions of the Unicode Standard (section 3.13, toUppercase and toLowercase) for UnicodeProperties.UnicodeVersion: the mappings of SpecialCasing.txt, else the simple mappings of UnicodeData.txt, a code point being able to map to several ones. The conditional mappings of SpecialCasing.txt are applied:
- In every language, a capital sigma (U+03A3) lowercases to the final sigma (U+03C2) at the end of a word, when it is preceded by a cased letter and not followed by one, ignoring the case-ignorable characters between them (Final_Sigma); else to the small sigma (U+03C3). A character that is both cased and case-ignorable, such as the modifier letter U+02B0, is ignored, as ICU does.
- In Turkish and Azerbaijani (
tr,az),Ilowercases to the dotlessi(U+0131), the dotted capital I (U+0130) toi, andIfollowed by a combining dot above (U+0307) toi;iuppercases to the dotted capital I (U+0130). - In Lithuanian (
lt), the lowercaseikeeps its dot under an accent:I,Jand the I with ogonek (U+012E) followed by an accent above lowercase with a combining dot above (U+0307), and the I with grave, acute or tilde (U+00CC, U+00CD, U+0128) toi, a dot above and the accent. Uppercasing removes the combining dot above that follows a soft-dotted letter such asiorj, with no character of combining class 0 or 230 between them.
The other languages have no tailoring in SpecialCasing.txt: the mappings of the Common Locale Data Repository, such as the removal of the Greek accents when uppercasing, are not applied.
The conversions do not use the globalization library of the platform: the results are the same on every platform and every framework version, including in globalization-invariant mode. An unpaired surrogate is copied as is.
See also
Methods
| Name | Description |
|---|---|
| ToLower(string, string?) | Converts a text to lowercase. |
| ToUpper(string, string?) | Converts a text to uppercase. |
ToLower(string, string?)
UnicodeCaseMapping.csConverts a text to lowercase.
Parameters
valuestring- The text.
languagestring?- The language of the text, as a BCP 47 language tag such as
trorlt-LT, ornullfor the mappings that do not depend on the language. Only the language subtag is read, ignoring case:tr,azandlt(ortur,azeandlit) select their mappings, and every other language uses the mappings that do not depend on the language.
Returns
string The text in lowercase; value itself when no character changes.
Exceptions
ArgumentNullExceptionvalueisnull.
ToUpper(string, string?)
UnicodeCaseMapping.csConverts a text to uppercase.
Parameters
valuestring- The text.
languagestring?- The language of the text, as a BCP 47 language tag such as
trorlt-LT, ornullfor the mappings that do not depend on the language. Only the language subtag is read, ignoring case:tr,azandlt(ortur,azeandlit) select their mappings, and every other language uses the mappings that do not depend on the language.
Returns
string The text in uppercase; value itself when no character changes.
Exceptions
ArgumentNullExceptionvalueisnull.