Unicode​Characters Unicode​Characters Unicode​Characters Class

Definition

Provides a way for apps to get information about Unicode characters, per the Unicode Standard Annex #44.

public static class UnicodeCharacterspublic static class UnicodeCharactersPublic Static Class UnicodeCharacters
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Use GetCodepointFromSurrogatePair to prepare Unicode characters before you pass them to any of the other methods of this class, in order to properly process supplementary characters. See Surrogates and Supplementary Characters for a discussion of supplementary Unicode characters.

The normal procedure for processing the code points in a stream is to:

  1. Use IsHighSurrogate to determine if a code point is a high surrogate.
  2. If it is not, pass it to the desired method of UnicodeCharacters.
  3. Else the code point is a high surrogate:1. Use IsLowSurrogate to check the next code point in the stream to determine if it is a low surrogate.
  4. If it is not, you have an invalid sequence of code points.
  5. Else the second code point is a low surrogate. Pass the high and low pair to GetCodepointFromSurrogatePair to obtain the supplementary Unicode character that can be passed on to the desired method.

The methods in this class throw an invalid argument exception if the input is not a valid codepoint.

Methods

GetCodepointFromSurrogatePair(UInt32, UInt32) GetCodepointFromSurrogatePair(UInt32, UInt32) GetCodepointFromSurrogatePair(UInt32, UInt32)

Returns the supplementary Unicode character for the specified high and low surrogate pair.

public static unsigned short GetCodepointFromSurrogatePair(UInt32 highSurrogate, UInt32 lowSurrogate)public static uint GetCodepointFromSurrogatePair(UInt32 highSurrogate, UInt32 lowSurrogate)Public Static Function GetCodepointFromSurrogatePair(highSurrogate As UInt32, lowSurrogate As UInt32) As uint
Parameters
highSurrogate
System.UInt32 System.UInt32 System.UInt32

The high surrogate value. This must be in the proper range: 0xD800 <= highSurrogate <= 0xDBFF.

lowSurrogate
System.UInt32 System.UInt32 System.UInt32

The low surrogate value. This must be in the proper range: 0xDC00 <= lowSurrogate <= 0xDFFF.

Returns
uint uint uint

The supplementary Unicode character.

Attributes
See Also

GetGeneralCategory(UInt32) GetGeneralCategory(UInt32) GetGeneralCategory(UInt32)

Returns the UnicodeGeneralCategory of the specified Unicode character.

public static UnicodeGeneralCategory GetGeneralCategory(UInt32 codepoint)public static UnicodeGeneralCategory GetGeneralCategory(UInt32 codepoint)Public Static Function GetGeneralCategory(codepoint As UInt32) As UnicodeGeneralCategory
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns

The Unicode general category for codepoint.

Attributes

GetNumericType(UInt32) GetNumericType(UInt32) GetNumericType(UInt32)

Returns the UnicodeNumericType of the specified Unicode character.

public static UnicodeNumericType GetNumericType(UInt32 codepoint)public static UnicodeNumericType GetNumericType(UInt32 codepoint)Public Static Function GetNumericType(codepoint As UInt32) As UnicodeNumericType
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns

The Unicode numeric type for codepoint.

Attributes

GetSurrogatePairFromCodepoint(UInt32, Char, Char) GetSurrogatePairFromCodepoint(UInt32, Char, Char) GetSurrogatePairFromCodepoint(UInt32, Char, Char)

Returns the high and low surrogate pair values for the specified supplementary Unicode character.

public static void GetSurrogatePairFromCodepoint(UInt32 codepoint, Char highSurrogate, Char lowSurrogate)public static void GetSurrogatePairFromCodepoint(UInt32 codepoint, Char highSurrogate, Char lowSurrogate)Public Static Function GetSurrogatePairFromCodepoint(codepoint As UInt32, highSurrogate As Char, lowSurrogate As Char) As void
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

highSurrogate
System.Char System.Char System.Char

The high surrogate value returned.

lowSurrogate
System.Char System.Char System.Char

The low surrogate value returned.

Attributes

Remarks

See Surrogates and Supplementary Characters for a discussion of supplementary Unicode characters.

See Also

IsAlphabetic(UInt32) IsAlphabetic(UInt32) IsAlphabetic(UInt32)

Determines if a specified Unicode character can be considered alphabetic.

public static PlatForm::Boolean IsAlphabetic(UInt32 codepoint)public static bool IsAlphabetic(UInt32 codepoint)Public Static Function IsAlphabetic(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is alphabetic; otherwise FALSE.

Attributes

IsCased(UInt32) IsCased(UInt32) IsCased(UInt32)

Determines if a specified Unicode character can be considered cased (uppercase, lowercase or titlecase).

public static PlatForm::Boolean IsCased(UInt32 codepoint)public static bool IsCased(UInt32 codepoint)Public Static Function IsCased(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is cased; otherwise FALSE.

Attributes

IsGraphemeBase(UInt32) IsGraphemeBase(UInt32) IsGraphemeBase(UInt32)

Determines if a specified Unicode character can be considered the beginning of a grapheme.

public static PlatForm::Boolean IsGraphemeBase(UInt32 codepoint)public static bool IsGraphemeBase(UInt32 codepoint)Public Static Function IsGraphemeBase(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is the beginning of a grapheme; otherwise FALSE.

Attributes

IsGraphemeExtend(UInt32) IsGraphemeExtend(UInt32) IsGraphemeExtend(UInt32)

Determines if a specified Unicode character can be considered to continue a previous grapheme.

public static PlatForm::Boolean IsGraphemeExtend(UInt32 codepoint)public static bool IsGraphemeExtend(UInt32 codepoint)Public Static Function IsGraphemeExtend(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint continues the previous grapheme; otherwise FALSE.

Attributes

IsHighSurrogate(UInt32) IsHighSurrogate(UInt32) IsHighSurrogate(UInt32)

Determines if a specified Unicode character is a high surrogate.

public static PlatForm::Boolean IsHighSurrogate(UInt32 codepoint)public static bool IsHighSurrogate(UInt32 codepoint)Public Static Function IsHighSurrogate(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is a high surrogate; otherwise FALSE.

Attributes
See Also

IsIdContinue(UInt32) IsIdContinue(UInt32) IsIdContinue(UInt32)

Determines if a specified Unicode character can be considered a continuation character of an identifier in programming.

public static PlatForm::Boolean IsIdContinue(UInt32 codepoint)public static bool IsIdContinue(UInt32 codepoint)Public Static Function IsIdContinue(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is a continuation character of an identifier in programming; otherwise FALSE.

Attributes

IsIdStart(UInt32) IsIdStart(UInt32) IsIdStart(UInt32)

Determines if a specified Unicode character can be considered the start character of an identifier in programming.

public static PlatForm::Boolean IsIdStart(UInt32 codepoint)public static bool IsIdStart(UInt32 codepoint)Public Static Function IsIdStart(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is the start character of an identifier in programming; otherwise FALSE.

Attributes

IsLowercase(UInt32) IsLowercase(UInt32) IsLowercase(UInt32)

Determines if a specified Unicode character can be considered a lower case character.

public static PlatForm::Boolean IsLowercase(UInt32 codepoint)public static bool IsLowercase(UInt32 codepoint)Public Static Function IsLowercase(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is a lower case character; otherwise FALSE.

Attributes

IsLowSurrogate(UInt32) IsLowSurrogate(UInt32) IsLowSurrogate(UInt32)

Determines if a specified Unicode character is a low surrogate.

public static PlatForm::Boolean IsLowSurrogate(UInt32 codepoint)public static bool IsLowSurrogate(UInt32 codepoint)Public Static Function IsLowSurrogate(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is a low surrogate; otherwise FALSE.

Attributes
See Also

IsNoncharacter(UInt32) IsNoncharacter(UInt32) IsNoncharacter(UInt32)

Determines if a specified codepoint is a non-character.

public static PlatForm::Boolean IsNoncharacter(UInt32 codepoint)public static bool IsNoncharacter(UInt32 codepoint)Public Static Function IsNoncharacter(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is a non-character; otherwise FALSE.

Attributes

Remarks

This method determines if codepoint is a one of the invalid Unicode code points (U+FFD0 through U+FFEF, U+xxFFFE, or U+xxFFFF).

IsSupplementary(UInt32) IsSupplementary(UInt32) IsSupplementary(UInt32)

Determines if a specified Unicode character is a supplementary character.

public static PlatForm::Boolean IsSupplementary(UInt32 codepoint)public static bool IsSupplementary(UInt32 codepoint)Public Static Function IsSupplementary(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is a supplementary character; otherwise FALSE.

Attributes

Remarks

This method determines if codepoint is a supplementary character (greater than 0xFFFF).

IsUppercase(UInt32) IsUppercase(UInt32) IsUppercase(UInt32)

Determines if a specified Unicode character can be considered an upper case character.

public static PlatForm::Boolean IsUppercase(UInt32 codepoint)public static bool IsUppercase(UInt32 codepoint)Public Static Function IsUppercase(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is an upper case character; otherwise FALSE.

Attributes

IsWhitespace(UInt32) IsWhitespace(UInt32) IsWhitespace(UInt32)

Determines if a specified Unicode character can be considered whitespace.

public static PlatForm::Boolean IsWhitespace(UInt32 codepoint)public static bool IsWhitespace(UInt32 codepoint)Public Static Function IsWhitespace(codepoint As UInt32) As bool
Parameters
codepoint
System.UInt32 System.UInt32 System.UInt32

A Unicode character. This must be in the proper range: 0 <= codepoint <= 0x10FFFF.

Returns
bool bool bool

TRUE if codepoint is whitespace; otherwise FALSE.

Attributes

See Also