<PackageReference Include="System.Text.Encodings.Web" Version="6.0.1" />

Rune

struct Rune
public static Rune ReplacementChar { get; }

A Rune instance that represents the Unicode replacement character U+FFFD.

public bool IsAscii { get; }

Returns true if and only if this scalar value is ASCII ([ U+0000..U+007F ]) and therefore representable by a single UTF-8 code unit.

public bool IsBmp { get; }

Returns true if and only if this scalar value is within the BMP ([ U+0000..U+FFFF ]) and therefore representable by a single UTF-16 code unit.

public int Utf16SequenceLength { get; }

Returns the length in code units ( Char) of the UTF-16 sequence required to represent this scalar value.

public int Value { get; }

Returns the Unicode scalar value as an integer.

public Rune(uint value)

Creates a Rune from the provided Unicode scalar value.

public Rune(int value)

Creates a Rune from the provided Unicode scalar value.

public static OperationStatus DecodeFromUtf16(ReadOnlySpan<char> source, out Rune result, out int charsConsumed)

Decodes the Rune at the beginning of the provided UTF-16 source buffer.

public static OperationStatus DecodeFromUtf8(ReadOnlySpan<byte> source, out Rune result, out int bytesConsumed)

Decodes the Rune at the beginning of the provided UTF-8 source buffer.

public static bool IsControl(Rune value)

public static bool op_Equality(Rune left, Rune right)

public static bool op_Inequality(Rune left, Rune right)

public static bool TryCreate(char ch, out Rune result)

Attempts to create a Rune from the provided input value.

public static bool TryCreate(char highSurrogate, char lowSurrogate, out Rune result)

Attempts to create a Rune from the provided UTF-16 surrogate pair. Returns false if the input values don't represent a well-formed UTF-16surrogate pair.

public bool Equals(Rune other)

public bool TryEncodeToUtf16(Span<char> destination, out int charsWritten)

Encodes this Rune to a UTF-16 destination buffer.

public bool TryEncodeToUtf8(Span<byte> destination, out int bytesWritten)

Encodes this Rune to a destination buffer as UTF-8 bytes.