UnicodeProperties Class

Provides the properties of a code point defined by the Unicode Character Database.

public static class UnicodeProperties

Remarks

Every method takes a code point as an Int32 and never allocates: the values are read from tables indexed by the code point. Only the methods that write to a buffer throw, when the buffer is too small. An integer that is not a code point (negative, or greater than U+10FFFF) has the default value of the property, the one of a code point the standard does not list.

The values are those of one version of the Unicode Standard, UnicodeProperties.UnicodeVersion, whatever the version the runtime implements: the results are the same on every platform and every framework version.

See also

Properties

NameDescription
MaxCaseMappingLengthGets the greatest number of code points a full case mapping writes for a code point.
UnicodeVersionGets the version of the Unicode Standard the properties come from.

MaxCaseMappingLength

UnicodeProperties.cs

Gets the greatest number of code points a full case mapping writes for a code point.

public static int MaxCaseMappingLength { get; }

UnicodeVersion

UnicodeProperties.cs

Gets the version of the Unicode Standard the properties come from.

public static Version UnicodeVersion { get; }

Property value

Version

Methods

NameDescription
GetBidiClass(int)Gets the Bidi_Class of a code point.
GetBidiPairedBracketType(int)Gets the Bidi_Paired_Bracket_Type of a code point.
GetBinaryPropertyRanges(UnicodeBinaryProperty)Gets the code points that have a binary property.
GetCanonicalCombiningClass(int)Gets the Canonical_Combining_Class of a code point.
GetEastAsianWidth(int)Gets the East_Asian_Width property of a code point.
GetGeneralCategory(int)Gets the General_Category of a code point.
GetGraphemeClusterBreak(int)Gets the Grapheme_Cluster_Break property of a code point.
GetIndicConjunctBreak(int)Gets the Indic_Conjunct_Break property of a code point.
GetIndicPositionalCategory(int)Gets the Indic_Positional_Category property of a code point.
GetIndicSyllabicCategory(int)Gets the Indic_Syllabic_Category property of a code point.
GetJoiningGroup(int)Gets the Joining_Group property of a code point.
GetJoiningType(int)Gets the Joining_Type property of a code point.
GetLineBreakClass(int)Gets the Line_Break property of a code point.
GetLowercaseMapping(int, Span<int>)Gets the full Lowercase_Mapping of a code point, which can be several code points (İ, U+0130, → U+0069 U+0307).
GetSentenceBreak(int)Gets the Sentence_Break property of a code point.
GetTitlecaseMapping(int, Span<int>)Gets the full Titlecase_Mapping of a code point, which can be several code points (fi → Fi).
GetUppercaseMapping(int, Span<int>)Gets the full Uppercase_Mapping of a code point, which can be several code points (ß → SS).
GetVerticalOrientation(int)Gets the Vertical_Orientation property of a code point: how the character is set in a line of vertical text.
GetWordBreak(int)Gets the Word_Break property of a code point.
HasBinaryProperty(int, UnicodeBinaryProperty)Determines whether a code point has a binary property.
IsBidiMirrored(int)Determines whether a code point has the Bidi_Mirrored property.
IsCaseIgnorable(int)Determines whether a code point has the Case_Ignorable property: whether the case mappings skip it when they look at the context.
IsCased(int)Determines whether a code point has the Cased property: whether it is an uppercase, a lowercase or a titlecase character.
IsDefaultIgnorable(int)Determines whether a code point has the Default_Ignorable_Code_Point property.
IsIdContinue(int)Determines whether a code point has the ID_Continue property: whether it can follow the first code point of an identifier.
IsIdStart(int)Determines whether a code point has the ID_Start property: whether it can start an identifier.
IsSoftDotted(int)Determines whether a code point has the Soft_Dotted property: whether its dot disappears when an accent is placed above it, as for i and j.
ToSimpleCaseFold(int)Gets the Simple_Case_Folding of a code point: the mappings of CaseFolding.txt whose status is C or S.
ToSimpleLowercase(int)Gets the Simple_Lowercase_Mapping of a code point.
ToSimpleTitlecase(int)Gets the Simple_Titlecase_Mapping of a code point: the form of the code point at the start of a word.
ToSimpleUppercase(int)Gets the Simple_Uppercase_Mapping of a code point.
TryGetBidiMirroringGlyph(int, int)Gets the Bidi_Mirroring_Glyph of a code point.
TryGetBidiPairedBracket(int, int)Gets the Bidi_Paired_Bracket of a code point.

GetBidiClass(int)

UnicodeProperties.cs

Gets the Bidi_Class of a code point.

public static UnicodeBidirectionalCategory GetBidiClass(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeBidirectionalCategory The bidirectional class. An unassigned code point has the default class of its range (for instance UnicodeBidirectionalCategory.RightToLeft in the Hebrew block), as the Unicode Bidirectional Algorithm requires.

See also

GetBidiPairedBracketType(int)

UnicodeProperties.cs

Gets the Bidi_Paired_Bracket_Type of a code point.

public static UnicodeBidiPairedBracketType GetBidiPairedBracketType(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeBidiPairedBracketType Whether the code point is an opening bracket, a closing bracket or neither.

GetBinaryPropertyRanges(UnicodeBinaryProperty)

UnicodeProperties.cs

Gets the code points that have a binary property.

public static UnicodeRange[] GetBinaryPropertyRanges(UnicodeBinaryProperty property)

Parameters

property UnicodeBinaryProperty
The property.

Returns

UnicodeRange[] The ranges of the code points that have the property, in increasing order. The ranges neither overlap nor touch.

Exceptions

ArgumentOutOfRangeException
property is not a value of UnicodeBinaryProperty.

Remarks

Each call returns a new array.

GetCanonicalCombiningClass(int)

UnicodeProperties.cs

Gets the Canonical_Combining_Class of a code point.

public static byte GetCanonicalCombiningClass(int codePoint)

Parameters

codePoint int
The code point.

Returns

byte The combining class; 0 for a starter.

GetEastAsianWidth(int)

UnicodeProperties.cs

Gets the East_Asian_Width property of a code point.

public static UnicodeEastAsianWidth GetEastAsianWidth(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeEastAsianWidth The width class.

See also

GetGeneralCategory(int)

UnicodeProperties.cs

Gets the General_Category of a code point.

public static UnicodeCategory GetGeneralCategory(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeCategory The category; UnicodeCategory.OtherNotAssigned for an unassigned code point.

GetGraphemeClusterBreak(int)

UnicodeProperties.cs

Gets the Grapheme_Cluster_Break property of a code point.

public static UnicodeGraphemeClusterBreak GetGraphemeClusterBreak(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeGraphemeClusterBreak The class used by the grapheme cluster boundary rules.

See also

GetIndicConjunctBreak(int)

UnicodeProperties.cs

Gets the Indic_Conjunct_Break property of a code point.

public static UnicodeIndicConjunctBreak GetIndicConjunctBreak(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeIndicConjunctBreak The class used by the grapheme cluster rule that keeps Indic conjuncts together (GB9c).

GetIndicPositionalCategory(int)

UnicodeProperties.cs

Gets the Indic_Positional_Category property of a code point.

public static UnicodeIndicPositionalCategory GetIndicPositionalCategory(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeIndicPositionalCategory Where a dependent vowel or another mark is placed relative to its base.

GetIndicSyllabicCategory(int)

UnicodeProperties.cs

Gets the Indic_Syllabic_Category property of a code point.

public static UnicodeIndicSyllabicCategory GetIndicSyllabicCategory(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeIndicSyllabicCategory The role of the code point in the syllables of the Brahmi-derived scripts.

GetJoiningGroup(int)

UnicodeProperties.cs

Gets the Joining_Group property of a code point.

public static UnicodeJoiningGroup GetJoiningGroup(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeJoiningGroup The group of letters that share the joining behavior and the basic shapes of the code point.

GetJoiningType(int)

UnicodeProperties.cs

Gets the Joining_Type property of a code point.

public static UnicodeJoiningType GetJoiningType(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeJoiningType How the code point joins its neighbors in a cursive script such as Arabic.

GetLineBreakClass(int)

UnicodeProperties.cs

Gets the Line_Break property of a code point.

public static UnicodeLineBreakClass GetLineBreakClass(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeLineBreakClass The class as listed by the standard, before the resolution of the Unicode Line Breaking Algorithm (rule LB1).

See also

GetLowercaseMapping(int, Span<int>)

UnicodeProperties.cs

Gets the full Lowercase_Mapping of a code point, which can be several code points (İ, U+0130, → U+0069 U+0307).

public static int GetLowercaseMapping(int codePoint, Span<int> destination)

Parameters

codePoint int
The code point.
destination Span<int>
The buffer that receives the code points of the mapping.

Returns

int The number of code points written. It is 1, codePoint itself, when the code point has no mapping.

Exceptions

ArgumentException
destination is too small. UnicodeProperties.MaxCaseMappingLength elements are always enough.

Remarks

The mapping is the default case conversion of the Unicode Standard (section 3.13) without its conditional mappings: the unconditional mappings of SpecialCasing.txt, else the simple mapping. The mappings that depend on the language (Turkish, Lithuanian) or on the context (the final sigma) are not applied: UnicodeCaseMapping applies them to a text.

GetSentenceBreak(int)

UnicodeProperties.cs

Gets the Sentence_Break property of a code point.

public static UnicodeSentenceBreak GetSentenceBreak(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeSentenceBreak The class used by the sentence boundary rules.

See also

GetTitlecaseMapping(int, Span<int>)

UnicodeProperties.cs

Gets the full Titlecase_Mapping of a code point, which can be several code points (fi → Fi).

public static int GetTitlecaseMapping(int codePoint, Span<int> destination)

Parameters

codePoint int
The code point.
destination Span<int>
The buffer that receives the code points of the mapping.

Returns

int The number of code points written. It is 1, codePoint itself, when the code point has no mapping.

Exceptions

ArgumentException
destination is too small. UnicodeProperties.MaxCaseMappingLength elements are always enough.

Remarks

The mapping is the default case conversion of the Unicode Standard (section 3.13) without its conditional mappings: the unconditional mappings of SpecialCasing.txt, else the simple mapping. The mappings that depend on the language (Turkish, Lithuanian) or on the context (the final sigma) are not applied: UnicodeCaseMapping applies them to a text.

GetUppercaseMapping(int, Span<int>)

UnicodeProperties.cs

Gets the full Uppercase_Mapping of a code point, which can be several code points (ß → SS).

public static int GetUppercaseMapping(int codePoint, Span<int> destination)

Parameters

codePoint int
The code point.
destination Span<int>
The buffer that receives the code points of the mapping.

Returns

int The number of code points written. It is 1, codePoint itself, when the code point has no mapping.

Exceptions

ArgumentException
destination is too small. UnicodeProperties.MaxCaseMappingLength elements are always enough.

Remarks

The mapping is the default case conversion of the Unicode Standard (section 3.13) without its conditional mappings: the unconditional mappings of SpecialCasing.txt, else the simple mapping. The mappings that depend on the language (Turkish, Lithuanian) or on the context (the final sigma) are not applied: UnicodeCaseMapping applies them to a text.

GetVerticalOrientation(int)

UnicodeProperties.cs

Gets the Vertical_Orientation property of a code point: how the character is set in a line of vertical text.

public static UnicodeVerticalOrientation GetVerticalOrientation(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeVerticalOrientation The orientation: upright as in a horizontal line, rotated by a quarter turn clockwise, or one of the two with another glyph than in a horizontal line. A value that is not a code point is rotated, the default of the property.

See also

GetWordBreak(int)

UnicodeProperties.cs

Gets the Word_Break property of a code point.

public static UnicodeWordBreak GetWordBreak(int codePoint)

Parameters

codePoint int
The code point.

Returns

UnicodeWordBreak The class used by the word boundary rules.

See also

HasBinaryProperty(int, UnicodeBinaryProperty)

UnicodeProperties.cs

Determines whether a code point has a binary property.

public static bool HasBinaryProperty(int codePoint, UnicodeBinaryProperty property)

Parameters

codePoint int
The code point.
property UnicodeBinaryProperty
The property.

Returns

bool true when the code point has the property; false otherwise, and for an integer that is not a code point.

Exceptions

ArgumentOutOfRangeException
property is not a value of UnicodeBinaryProperty.

IsBidiMirrored(int)

UnicodeProperties.cs

Determines whether a code point has the Bidi_Mirrored property.

public static bool IsBidiMirrored(int codePoint)

Parameters

codePoint int
The code point.

Returns

bool true when the glyph of the code point is mirrored in right-to-left text.

IsCaseIgnorable(int)

UnicodeProperties.cs

Determines whether a code point has the Case_Ignorable property: whether the case mappings skip it when they look at the context.

public static bool IsCaseIgnorable(int codePoint)

Parameters

codePoint int
The code point.

Returns

bool true for the combining marks, the format characters, the modifier letters and symbols, and a few punctuation marks such as the apostrophe and the full stop.

Remarks

The property defines the context of the final sigma (The Unicode Standard, section 3.13).

Determines whether a code point has the Cased property: whether it is an uppercase, a lowercase or a titlecase character.

public static bool IsCased(int codePoint)

Parameters

codePoint int
The code point.

Returns

bool true when the code point is a letter that has a case, or another character with the Lowercase or Uppercase property such as U+2160 ROMAN NUMERAL ONE.

Remarks

The property defines the context of the final sigma (The Unicode Standard, section 3.13).

IsDefaultIgnorable(int)

UnicodeProperties.cs

Determines whether a code point has the Default_Ignorable_Code_Point property.

public static bool IsDefaultIgnorable(int codePoint)

Parameters

codePoint int
The code point.

Returns

bool true when the code point should have no visible glyph by default, like a variation selector or a zero-width joiner.

IsIdContinue(int)

UnicodeProperties.cs

Determines whether a code point has the ID_Continue property: whether it can follow the first code point of an identifier.

public static bool IsIdContinue(int codePoint)

Parameters

codePoint int
The code point.

Returns

bool true when the code point can be part of an identifier after its first code point, like a letter, a digit or a combining mark.

See also

IsIdStart(int)

UnicodeProperties.cs

Determines whether a code point has the ID_Start property: whether it can start an identifier.

public static bool IsIdStart(int codePoint)

Parameters

codePoint int
The code point.

Returns

bool true when the code point is a letter or a letter number that can start an identifier.

See also

IsSoftDotted(int)

UnicodeProperties.cs

Determines whether a code point has the Soft_Dotted property: whether its dot disappears when an accent is placed above it, as for i and j.

public static bool IsSoftDotted(int codePoint)

Parameters

codePoint int
The code point.

Returns

bool true when the code point is a soft-dotted letter.

Remarks

The property defines a context of the Lithuanian case mappings (The Unicode Standard, section 3.13).

ToSimpleCaseFold(int)

UnicodeProperties.cs

Gets the Simple_Case_Folding of a code point: the mappings of CaseFolding.txt whose status is C or S.

public static int ToSimpleCaseFold(int codePoint)

Parameters

codePoint int
The code point.

Returns

int The folded code point, or codePoint when it has no mapping.

Remarks

Two strings that differ only by case have the same simple case folding when their characters fold one to one; the full case folding (status F), which can map a code point to several ones (U+00DF to ss), is not applied. The Turkic mappings (status T) are not applied either.

ToSimpleLowercase(int)

UnicodeProperties.cs

Gets the Simple_Lowercase_Mapping of a code point.

public static int ToSimpleLowercase(int codePoint)

Parameters

codePoint int
The code point.

Returns

int The lowercase code point, or codePoint when it has no mapping.

Remarks

The mapping is the one-to-one, culture-independent mapping of the Unicode Character Database.

ToSimpleTitlecase(int)

UnicodeProperties.cs

Gets the Simple_Titlecase_Mapping of a code point: the form of the code point at the start of a word.

public static int ToSimpleTitlecase(int codePoint)

Parameters

codePoint int
The code point.

Returns

int The titlecase code point, or codePoint when it has no mapping. It is the UnicodeProperties.ToSimpleUppercase mapping, except for a few code points such as the Latin digraphs (dž → Dž) and the Georgian Mkhedruli letters.

Remarks

The mapping is the one-to-one, culture-independent mapping of the Unicode Character Database.

ToSimpleUppercase(int)

UnicodeProperties.cs

Gets the Simple_Uppercase_Mapping of a code point.

public static int ToSimpleUppercase(int codePoint)

Parameters

codePoint int
The code point.

Returns

int The uppercase code point, or codePoint when it has no mapping.

Remarks

The mapping is the one-to-one, culture-independent mapping of the Unicode Character Database.

TryGetBidiMirroringGlyph(int, int)

UnicodeProperties.cs

Gets the Bidi_Mirroring_Glyph of a code point.

public static bool TryGetBidiMirroringGlyph(int codePoint, out int mirrored)

Parameters

codePoint int
The code point.
mirrored int
The code point whose glyph is the mirror image, when the method returns true; otherwise codePoint.

Returns

bool true when another code point has the mirrored glyph. Some mirrored code points have none.

TryGetBidiPairedBracket(int, int)

UnicodeProperties.cs

Gets the Bidi_Paired_Bracket of a code point.

public static bool TryGetBidiPairedBracket(int codePoint, out int paired)

Parameters

codePoint int
The code point.
paired int
The other bracket of the pair, when the method returns true; otherwise codePoint.

Returns

bool true when the code point is an opening or a closing bracket.