<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0-preview.2.23128.3" />

UnicodeUtility

static class UnicodeUtility
public const uint ReplacementChar = 65533

The Unicode replacement character U+FFFD.

public static int GetPlane(uint codePoint)

Returns the Unicode plane (0 through 16, inclusive) which contains this code point.

public static uint GetScalarFromUtf16SurrogatePair(uint highSurrogateCodePoint, uint lowSurrogateCodePoint)

Returns a Unicode scalar value from two code points representing a UTF-16 surrogate pair.

public static int GetUtf16SequenceLength(uint value)

Given a Unicode scalar value, gets the number of UTF-16 code units required to represent this value.

public static void GetUtf16SurrogatesFromSupplementaryPlaneScalar(uint value, out char highSurrogateCodePoint, out char lowSurrogateCodePoint)

Decomposes an astral Unicode scalar into UTF-16 high and low surrogate code units.

public static int GetUtf8SequenceLength(uint value)

Given a Unicode scalar value, gets the number of UTF-8 code units required to represent this value.

public static bool IsAsciiCodePoint(uint value)

Returns true iff value is an ASCII character ([ U+0000..U+007F ]).

public static bool IsBmpCodePoint(uint value)

Returns true iff value is in the Basic Multilingual Plane (BMP).

public static bool IsHighSurrogateCodePoint(uint value)

Returns true iff value is a UTF-16 high surrogate code point, i.e., is in [ U+D800..U+DBFF ], inclusive.

public static bool IsInRangeInclusive(uint value, uint lowerBound, uint upperBound)

Returns true iff value is between lowerBound and upperBound, inclusive.

public static bool IsLowSurrogateCodePoint(uint value)

Returns true iff value is a UTF-16 low surrogate code point, i.e., is in [ U+DC00..U+DFFF ], inclusive.

public static bool IsSurrogateCodePoint(uint value)

Returns true iff value is a UTF-16 surrogate code point, i.e., is in [ U+D800..U+DFFF ], inclusive.

public static bool IsValidCodePoint(uint codePoint)

Returns true iff codePoint is a valid Unicode code point, i.e., is in [ U+0000..U+10FFFF ], inclusive.

public static bool IsValidUnicodeScalar(uint value)

Returns true iff value is a valid Unicode scalar value, i.e., is in [ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive.