static ubyte[] convert(Encoding sourceEncoding, Encoding destEncoding, ubyte[] bytes);
- Converts a byte array from one encoding to another.
Parameters
Encoding sourceEncoding
The encoding format of bytes.
Encoding destEncoding
The target encoding format.
ubyte[] bytes
The bytes to convert.
Returns
A byte array containing the results of converting bytes from srcEncoding to destEncoding.
static ubyte[] convert(Encoding sourceEncoding, Encoding destEncoding, ubyte[] bytes, int index, int count);
- Converts a range of bytes in a byte array from one encoding to another.
Parameters
Encoding sourceEncoding
The encoding format of bytes.
Encoding destEncoding
The target encoding format.
ubyte[] bytes
The bytes to convert.
int index
The index of the first element of bytes to convert.
int count
The number of bytes to convert.
Returns
A byte array containing the results of converting bytes from srcEncoding to destEncoding.
abstract int encodeLength(char[] chars, int index, int count);
int encodeLength(char[] chars);
abstract int decodeLength(ubyte[] bytes, int index, int count);
int decodeLength(ubyte[] bytes);
ubyte[] encode(char[] chars, int index, int count);
ubyte[] encode(char[] chars);
- Encodes a set of characters from the specified character array into a sequence of bytes.
Parameters
char[] chars
The character array containing the set of characters to encode.
int index
The index of the first character to encode.
int count
The number of characters to encode.
Returns
A byte array containing the results of encoding the specified set of characters.
abstract int decode(ubyte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex);
char[] decode(ubyte[] bytes, int index, int count);
char[] decode(ubyte[] bytes);
- Decodes a sequence of bytes from the specified byte array into a set of characters.
Parameters
ubyte[] bytes
The byte array containing the sequence of bytes to decode.
int index
The index of the first byte to decode.
int count
The number of bytes to decode.
Returns
A character array containing the results of decoding the specified sequence of bytes.
static Encoding get(uint codePage);
- Returns an encoding associated with the specified code page identifier.
Parameters
uint codePage
The code page identifier of the encoding.
Returns
The encoding associated with the specified code page.
static Encoding get(char[] name);
- Returns an encoding associated with the specified code page name.
Parameters
char[] name
The code page name of the encoding.
Returns
The encoding associated with the specified code page.
static Encoding DEFAULT();
- Gets an encoding for the system's ANSI code page.
Returns
An encoding for the system's ANSI code page.
static Encoding ASCII();
- Gets an encoding for the ASCII character set.
Returns
An encoding for the ASCII character set.
static Encoding UTF7();
- Gets an encoding for the UTF-7 format.
Returns
An encoding for the UTF-7 format.
static Encoding UTF8();
- Gets an encoding for the UTF-8 format.
Returns
An encoding for the UTF-8 format.
static Encoding UTF16();
- Gets an encoding for the UTF-16 format using the little endian byte order.
Returns
An encoding for the UTF-16 format using the little endian byte order.
char[] description();
- Gets a description of the encoding.
Returns
A description of the encoding.
char[] webName();
- Gets the name registered with the IANA.
Returns
The IANA name.
char[] headerName();
- Gets a name that can be used with mail agent header tags.
Returns
A name that can be used with mail agent header tags.
char[] bodyName();
- Gets a name that can be used with mail agent body tags.
Returns
A name that can be used with mail agent body tags.
this(uint codePage);
- Initialize a new instance that corresponds to the specified code page.
Parameters
uint codePage
The code page identifier of the encoding.