Table of Contents

Class UTF8Encoding

Namespace
System.Text
Assembly
nanoFramework.System.Text.dll

Represents a UTF-8 encoding of Unicode characters.

public class UTF8Encoding : Encoding
Inheritance
UTF8Encoding
Inherited Members
Extension Methods

Constructors

UTF8Encoding()

Represents a UTF-8 encoding of Unicode characters.

public UTF8Encoding()

Methods

GetBytes(string)

public override byte[] GetBytes(string s)

Parameters

s string

Returns

byte[]

GetBytes(string, int, int, byte[], int)

Encodes a set of characters from the specified string into the specified byte array.

public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)

Parameters

s string

The string containing the set of characters to encode.

charIndex int

The index of the first character to encode.

charCount int

The number of characters to encode.

bytes byte[]

The byte array to contain the resulting sequence of bytes.

byteIndex int

The index at which to start writing the resulting sequence of bytes.

Returns

int

The actual number of bytes written into bytes.

GetChars(byte[])

Decodes a sequence of bytes from the specified byte array into a set of characters.

public override char[] GetChars(byte[] bytes)

Parameters

bytes byte[]

The byte array containing the sequence of bytes to decode.

Returns

char[]

The actual number of characters returned.

GetChars(byte[], int, int)

Decodes a sequence of bytes from the specified byte array into a set of characters.

public override char[] GetChars(byte[] bytes, int byteIndex, int byteCount)

Parameters

bytes byte[]

The byte array containing the sequence of bytes to decode.

byteIndex int

The index of the first byte to decode.

byteCount int

The number of bytes to decode.

Returns

char[]

The actual number of characters returned.

GetDecoder()

Obtains a decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters.

public override Decoder GetDecoder()

Returns

Decoder

A decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters.