Interface
Encoding
interface Encoding
Module: System.Text
Assembly: System.Runtime.dll
Source file: Encoding.rvn
A reusable policy for converting valid text and encoded bytes.
Remarks
Development API. Implementations return owned, stable encoded data and independent decoders. Stream consumers do not switch on codec names. Use CreateEncoder for an independent incremental session. See selected encodings.
Methods
4 items
CreateDecoder() -> Decoder
Creates an independent incremental decoder.
Defined by Encoding.CreateDecoder · Required implementation (no default).
CreateEncoder() -> Encoder
Creates an independent incremental text-to-byte encoder.
Defined by Encoding.CreateEncoder · Required implementation (no default).
Decode(bytes: ReadOnlySlice<byte>) -> Result<string, EncodingError>
Decodes one complete borrowed byte window with strict error reporting and no retained session state. Built-in providers accept at most 65536 bytes, preserve BOM data and reject tru…
Defined by Encoding.Decode · Required implementation (no default).
Encode(text: string) -> Result<Sequence<byte>, EncodingError>
Encodes a complete text value.
Defined by Encoding.Encode · Required implementation (no default).