TextEncoder Class
https://encoding.spec.whatwg.org/#interface-textencoder
public sealed class TextEncoderConstructors
| Name | Description |
|---|---|
| TextEncoder() | Creates a UTF-8 encoder. |
TextEncoder()
TextDecoder.csCreates a UTF-8 encoder.
public TextEncoder()Properties
| Name | Description |
|---|---|
| Encoding | Gets the name of the encoding, which is always utf-8. |
Encoding
TextDecoder.csGets the name of the encoding, which is always utf-8.
public string Encoding { get; }Methods
| Name | Description |
|---|---|
| Encode(string) | Returns the UTF-8 bytes of the given string. |
| EncodeInto(string, Span<byte>) | Encodes the given string as UTF-8 into the destination and returns the number of units read and bytes written. |
Encode(string)
TextDecoder.csReturns the UTF-8 bytes of the given string.
EncodeInto(string, Span<byte>)
TextDecoder.csEncodes the given string as UTF-8 into the destination and returns the number of units read and bytes written.
public TextEncoderEncodeIntoResult EncodeInto(string source, Span<byte> destination)