August 2003
Intermediate to advanced
928 pages
32h 1m
English
UTF8Encoding
This class encodes Unicode characters as UTF-8, 8-bit characters. The overloaded constructor allows zero, one, or two boolean parameters. The first argument indicates whether the encoder should both emit the UTF-8 byte order mark code and recognize it. The second boolean argument specifies whether to throw an exception when invalid bytes are encountered.
public class UTF8Encoding : Encoding { // Public Constructors public UTF8Encoding( ); public UTF8Encoding(boolencoderShouldEmitUTF8Identifier); public UTF8Encoding(boolencoderShouldEmitUTF8Identifier, boolthrowOnInvalidBytes); // Public Instance Methods public override bool Equals(objectvalue); // overrides Encoding public override int GetByteCount(char[ ]chars, intindex, intcount) // overrides Encoding public override int GetByteCount(stringchars); // overrides Encoding public override byte[ ] GetBytes(strings); // overrides Encoding public override int GetBytes(char[ ]chars, intcharIndex, intcharCount, byte[ ]bytes, intbyteIndex) // overrides Encoding public override int GetBytes(strings, intcharIndex, intcharCount, byte[ ]bytes, intbyteIndex) // overrides Encoding public override int GetCharCount(byte[ ]bytes, intindex, intcount) // overrides Encoding public override int GetChars(byte[ ]bytes, intbyteIndex, intbyteCount, char[ ]chars, intcharIndex) // overrides Encoding public override Decoder GetDecoder( ); // overrides Encoding public override Encoder GetEncoder( ); // overrides ...