mscorlib(4.0.0.0) API with additions
|
Represents a character encoding.To browse the .NET Framework source code for this type, see the Reference Source. More...
Public Member Functions | |
virtual byte [] | GetPreamble () |
When overridden in a derived class, returns a sequence of bytes that specifies the encoding used. More... | |
virtual object | Clone () |
When overridden in a derived class, creates a shallow copy of the current T:System.Text.Encoding object. More... | |
virtual int | GetByteCount (char[] chars) |
When overridden in a derived class, calculates the number of bytes produced by encoding all the characters in the specified character array. More... | |
virtual int | GetByteCount (string s) |
When overridden in a derived class, calculates the number of bytes produced by encoding the characters in the specified string. More... | |
abstract int | GetByteCount (char[] chars, int index, int count) |
When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array. More... | |
virtual unsafe int | GetByteCount (char *chars, int count) |
When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. More... | |
virtual byte [] | GetBytes (char[] chars) |
When overridden in a derived class, encodes all the characters in the specified character array into a sequence of bytes. More... | |
virtual byte [] | GetBytes (char[] chars, int index, int count) |
When overridden in a derived class, encodes a set of characters from the specified character array into a sequence of bytes. More... | |
abstract int | GetBytes (char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) |
When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array. More... | |
virtual byte [] | GetBytes (string s) |
When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes. More... | |
virtual int | GetBytes (string s, int charIndex, int charCount, byte[] bytes, int byteIndex) |
When overridden in a derived class, encodes a set of characters from the specified string into the specified byte array. More... | |
virtual unsafe int | GetBytes (char *chars, int charCount, byte *bytes, int byteCount) |
When overridden in a derived class, encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer. More... | |
virtual int | GetCharCount (byte[] bytes) |
When overridden in a derived class, calculates the number of characters produced by decoding all the bytes in the specified byte array. More... | |
abstract int | GetCharCount (byte[] bytes, int index, int count) |
When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. More... | |
virtual unsafe int | GetCharCount (byte *bytes, int count) |
When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. More... | |
virtual char [] | GetChars (byte[] bytes) |
When overridden in a derived class, decodes all the bytes in the specified byte array into a set of characters. More... | |
virtual char [] | GetChars (byte[] bytes, int index, int count) |
When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a set of characters. More... | |
abstract int | GetChars (byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) |
When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array. More... | |
virtual unsafe int | GetChars (byte *bytes, int byteCount, char *chars, int charCount) |
When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer. More... | |
unsafe string | GetString (byte *bytes, int byteCount) |
When overridden in a derived class, decodes a specified number of bytes starting at a specified address into a string. More... | |
bool | IsAlwaysNormalized () |
Gets a value indicating whether the current encoding is always normalized, using the default normalization form. More... | |
virtual bool | IsAlwaysNormalized (NormalizationForm form) |
When overridden in a derived class, gets a value indicating whether the current encoding is always normalized, using the specified normalization form. More... | |
virtual Decoder | GetDecoder () |
When overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters. More... | |
virtual Encoder | GetEncoder () |
When overridden in a derived class, obtains an encoder that converts a sequence of Unicode characters into an encoded sequence of bytes. More... | |
abstract int | GetMaxByteCount (int charCount) |
When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters. More... | |
abstract int | GetMaxCharCount (int byteCount) |
When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes. More... | |
virtual string | GetString (byte[] bytes) |
When overridden in a derived class, decodes all the bytes in the specified byte array into a string. More... | |
virtual string | GetString (byte[] bytes, int index, int count) |
When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a string. More... | |
override bool | Equals (object value) |
Determines whether the specified T:System.Object is equal to the current instance. More... | |
override int | GetHashCode () |
Returns the hash code for the current instance. More... | |
Static Public Member Functions | |
static byte [] | Convert (Encoding srcEncoding, Encoding dstEncoding, byte[] bytes) |
Converts an entire byte array from one encoding to another. More... | |
static byte [] | Convert (Encoding srcEncoding, Encoding dstEncoding, byte[] bytes, int index, int count) |
Converts a range of bytes in a byte array from one encoding to another. More... | |
static void | RegisterProvider (EncodingProvider provider) |
Registers an encoding provider. More... | |
static Encoding | GetEncoding (int codepage) |
Returns the encoding associated with the specified code page identifier. More... | |
static Encoding | GetEncoding (int codepage, EncoderFallback encoderFallback, DecoderFallback decoderFallback) |
Returns the encoding associated with the specified code page identifier. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded. More... | |
static Encoding | GetEncoding (string name) |
Returns the encoding associated with the specified code page name. More... | |
static Encoding | GetEncoding (string name, EncoderFallback encoderFallback, DecoderFallback decoderFallback) |
Returns the encoding associated with the specified code page name. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded. More... | |
static EncodingInfo [] | GetEncodings () |
Returns an array that contains all encodings. More... | |
Protected Member Functions | |
Encoding () | |
Initializes a new instance of the T:System.Text.Encoding class. More... | |
Encoding (int codePage) | |
Initializes a new instance of the T:System.Text.Encoding class that corresponds to the specified code page. More... | |
Encoding (int codePage, EncoderFallback encoderFallback, DecoderFallback decoderFallback) | |
Initializes a new instance of the T:System.Text.Encoding class that corresponds to the specified code page with the specified encoder and decoder fallback strategies. More... | |
Properties | |
virtual string | BodyName [get] |
When overridden in a derived class, gets a name for the current encoding that can be used with mail agent body tags. More... | |
virtual string | EncodingName [get] |
When overridden in a derived class, gets the human-readable description of the current encoding. More... | |
virtual string | HeaderName [get] |
When overridden in a derived class, gets a name for the current encoding that can be used with mail agent header tags. More... | |
virtual string | WebName [get] |
When overridden in a derived class, gets the name registered with the Internet Assigned Numbers Authority (IANA) for the current encoding. More... | |
virtual int | WindowsCodePage [get] |
When overridden in a derived class, gets the Windows operating system code page that most closely corresponds to the current encoding. More... | |
virtual bool | IsBrowserDisplay [get] |
When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for displaying content. More... | |
virtual bool | IsBrowserSave [get] |
When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for saving content. More... | |
virtual bool | IsMailNewsDisplay [get] |
When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for displaying content. More... | |
virtual bool | IsMailNewsSave [get] |
When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for saving content. More... | |
virtual bool | IsSingleByte [get] |
When overridden in a derived class, gets a value indicating whether the current encoding uses single-byte code points. More... | |
EncoderFallback | EncoderFallback [get, set] |
Gets or sets the T:System.Text.EncoderFallback object for the current T:System.Text.Encoding object. More... | |
DecoderFallback | DecoderFallback [get, set] |
Gets or sets the T:System.Text.DecoderFallback object for the current T:System.Text.Encoding object. More... | |
bool | IsReadOnly [get] |
When overridden in a derived class, gets a value indicating whether the current encoding is read-only. More... | |
static Encoding | ASCII [get] |
Gets an encoding for the ASCII (7-bit) character set. More... | |
virtual int | CodePage [get] |
When overridden in a derived class, gets the code page identifier of the current T:System.Text.Encoding. More... | |
static Encoding | Default [get] |
Gets an encoding for the operating system's current ANSI code page. More... | |
static Encoding | Unicode [get] |
Gets an encoding for the UTF-16 format using the little endian byte order. More... | |
static Encoding | BigEndianUnicode [get] |
Gets an encoding for the UTF-16 format that uses the big endian byte order. More... | |
static Encoding | UTF7 [get] |
Gets an encoding for the UTF-7 format. More... | |
static Encoding | UTF8 [get] |
Gets an encoding for the UTF-8 format. More... | |
static Encoding | UTF32 [get] |
Gets an encoding for the UTF-32 format using the little endian byte order. More... | |
Represents a character encoding.To browse the .NET Framework source code for this type, see the Reference Source.
Definition at line 15 of file Encoding.cs.
|
protected |
Initializes a new instance of the T:System.Text.Encoding class.
Definition at line 1053 of file Encoding.cs.
|
protected |
Initializes a new instance of the T:System.Text.Encoding class that corresponds to the specified code page.
codePage | The code page identifier of the preferred encoding.-or- 0, to use the default encoding. |
T:System.ArgumentOutOfRangeException | codePage is less than zero. |
Definition at line 1063 of file Encoding.cs.
|
protected |
Initializes a new instance of the T:System.Text.Encoding class that corresponds to the specified code page with the specified encoder and decoder fallback strategies.
codePage | The encoding code page identifier. |
encoderFallback | An object that provides an error-handling procedure when a character cannot be encoded with the current encoding. |
decoderFallback | An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding. |
T:System.ArgumentOutOfRangeException | codePage is less than zero. |
Definition at line 1080 of file Encoding.cs.
|
virtual |
When overridden in a derived class, creates a shallow copy of the current T:System.Text.Encoding object.
Implements System.ICloneable.
Definition at line 1474 of file Encoding.cs.
|
static |
Converts an entire byte array from one encoding to another.
srcEncoding | The encoding format of bytes . |
dstEncoding | The target encoding format. |
bytes | The bytes to convert. |
T:System.ArgumentNullException | srcEncoding is null .-or- dstEncoding is null .-or- bytes is null . |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- srcEncoding. P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- dstEncoding. P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Definition at line 1185 of file Encoding.cs.
|
static |
Converts a range of bytes in a byte array from one encoding to another.
srcEncoding | The encoding of the source array, bytes . |
dstEncoding | The encoding of the output array. |
bytes | The array of bytes to convert. |
index | The index of the first element of bytes to convert. |
count | The number of bytes to convert. |
T:System.ArgumentNullException | srcEncoding is null .-or- dstEncoding is null .-or- bytes is null . |
T:System.ArgumentOutOfRangeException | index and count do not specify a valid range in the byte array. |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- srcEncoding. P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- dstEncoding. P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Definition at line 1214 of file Encoding.cs.
override bool System.Text.Encoding.Equals | ( | object | value | ) |
Determines whether the specified T:System.Object is equal to the current instance.
value | The T:System.Object to compare with the current instance. |
true
if value is an instance of T:System.Text.Encoding and is equal to the current instance; otherwise, false
. Definition at line 2039 of file Encoding.cs.
|
virtual |
When overridden in a derived class, calculates the number of bytes produced by encoding all the characters in the specified character array.
chars | The character array containing the characters to encode. |
T:System.ArgumentNullException | chars is null . |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Definition at line 1489 of file Encoding.cs.
|
virtual |
When overridden in a derived class, calculates the number of bytes produced by encoding the characters in the specified string.
s | The string containing the set of characters to encode. |
T:System.ArgumentNullException | s is null . |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Reimplemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
Definition at line 1506 of file Encoding.cs.
|
pure virtual |
When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array.
chars | The character array containing the set of characters to encode. |
index | The index of the first character to encode. |
count | The number of characters to encode. |
T:System.ArgumentNullException | chars is null . |
T:System.ArgumentOutOfRangeException | index or count is less than zero.-or- index and count do not denote a valid range in chars . |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Implemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
|
virtual |
When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer.
chars | A pointer to the first character to encode. |
count | The number of characters to encode. |
T:System.ArgumentNullException | chars is null . |
T:System.ArgumentOutOfRangeException | count is less than zero. |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Reimplemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
Definition at line 1544 of file Encoding.cs.
|
virtual |
When overridden in a derived class, encodes all the characters in the specified character array into a sequence of bytes.
chars | The character array containing the characters to encode. |
T:System.ArgumentNullException | chars is null . |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Definition at line 1576 of file Encoding.cs.
|
virtual |
When overridden in a derived class, encodes a set of characters from the specified character array into a sequence of bytes.
chars | The character array containing the set of characters to encode. |
index | The index of the first character to encode. |
count | The number of characters to encode. |
T:System.ArgumentNullException | chars is null . |
T:System.ArgumentOutOfRangeException | index or count is less than zero.-or- index and count do not denote a valid range in chars . |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Definition at line 1598 of file Encoding.cs.
|
pure virtual |
When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array.
chars | The character array containing the set of characters to encode. |
charIndex | The index of the first character to encode. |
charCount | The number of characters to encode. |
bytes | The byte array to contain the resulting sequence of bytes. |
byteIndex | The index at which to start writing the resulting sequence of bytes. |
T:System.ArgumentNullException | chars is null .-or- bytes is null . |
T:System.ArgumentOutOfRangeException | charIndex or charCount or byteIndex is less than zero.-or- charIndex and charCount do not denote a valid range in chars .-or- byteIndex is not a valid index in bytes . |
T:System.ArgumentException | bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Implemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
|
virtual |
When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes.
s | The string containing the characters to encode. |
T:System.ArgumentNullException | s is null . |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Definition at line 1634 of file Encoding.cs.
|
virtual |
When overridden in a derived class, encodes a set of characters from the specified string into the specified byte array.
s | The string containing the set of characters to encode. |
charIndex | The index of the first character to encode. |
charCount | The number of characters to encode. |
bytes | The byte array to contain the resulting sequence of bytes. |
byteIndex | The index at which to start writing the resulting sequence of bytes. |
T:System.ArgumentNullException | s is null .-or- bytes is null . |
T:System.ArgumentOutOfRangeException | charIndex or charCount or byteIndex is less than zero.-or- charIndex and charCount do not denote a valid range in chars .-or- byteIndex is not a valid index in bytes . |
T:System.ArgumentException | bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Reimplemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
Definition at line 1665 of file Encoding.cs.
|
virtual |
When overridden in a derived class, encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer.
chars | A pointer to the first character to encode. |
charCount | The number of characters to encode. |
bytes | A pointer to the location at which to start writing the resulting sequence of bytes. |
byteCount | The maximum number of bytes to write. |
T:System.ArgumentNullException | chars is null .-or- bytes is null . |
T:System.ArgumentOutOfRangeException | charCount or byteCount is less than zero. |
T:System.ArgumentException | byteCount is less than the resulting number of bytes. |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Reimplemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
Definition at line 1698 of file Encoding.cs.
|
virtual |
When overridden in a derived class, calculates the number of characters produced by decoding all the bytes in the specified byte array.
bytes | The byte array containing the sequence of bytes to decode. |
T:System.ArgumentNullException | bytes is null . |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Definition at line 1734 of file Encoding.cs.
|
pure virtual |
When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
bytes | The byte array containing the sequence of bytes to decode. |
index | The index of the first byte to decode. |
count | The number of bytes to decode. |
T:System.ArgumentNullException | bytes is null . |
T:System.ArgumentOutOfRangeException | index or count is less than zero.-or- index and count do not denote a valid range in bytes . |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Implemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
|
virtual |
When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer.
bytes | A pointer to the first byte to decode. |
count | The number of bytes to decode. |
T:System.ArgumentNullException | bytes is null . |
T:System.ArgumentOutOfRangeException | count is less than zero. |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Reimplemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
Definition at line 1771 of file Encoding.cs.
|
virtual |
When overridden in a derived class, decodes all the bytes in the specified byte array into a set of characters.
bytes | The byte array containing the sequence of bytes to decode. |
T:System.ArgumentNullException | bytes is null . |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Definition at line 1803 of file Encoding.cs.
|
virtual |
When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a set of characters.
bytes | The byte array containing the sequence of bytes to decode. |
index | The index of the first byte to decode. |
count | The number of bytes to decode. |
T:System.ArgumentNullException | bytes is null . |
T:System.ArgumentOutOfRangeException | index or count is less than zero.-or- index and count do not denote a valid range in bytes . |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Definition at line 1825 of file Encoding.cs.
|
pure virtual |
When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array.
bytes | The byte array containing the sequence of bytes to decode. |
byteIndex | The index of the first byte to decode. |
byteCount | The number of bytes to decode. |
chars | The character array to contain the resulting set of characters. |
charIndex | The index at which to start writing the resulting set of characters. |
T:System.ArgumentNullException | bytes is null .-or- chars is null . |
T:System.ArgumentOutOfRangeException | byteIndex or byteCount or charIndex is less than zero.-or- byteindex and byteCount do not denote a valid range in bytes .-or- charIndex is not a valid index in chars . |
T:System.ArgumentException | chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Implemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
|
virtual |
When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer.
bytes | A pointer to the first byte to decode. |
byteCount | The number of bytes to decode. |
chars | A pointer to the location at which to start writing the resulting set of characters. |
charCount | The maximum number of characters to write. |
T:System.ArgumentNullException | bytes is null .-or- chars is null . |
T:System.ArgumentOutOfRangeException | byteCount or charCount is less than zero. |
T:System.ArgumentException | charCount is less than the resulting number of characters. |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Reimplemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
Definition at line 1871 of file Encoding.cs.
|
virtual |
When overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters.
Reimplemented in System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, System.Text.UTF7Encoding, and System.Text.ASCIIEncoding.
Definition at line 1953 of file Encoding.cs.
|
virtual |
When overridden in a derived class, obtains an encoder that converts a sequence of Unicode characters into an encoded sequence of bytes.
Reimplemented in System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, System.Text.UTF7Encoding, and System.Text.ASCIIEncoding.
Definition at line 1972 of file Encoding.cs.
|
static |
Returns the encoding associated with the specified code page identifier.
codepage | The code page identifier of the preferred encoding. Possible values are listed in the Code Page column of the table that appears in the T:System.Text.Encoding class topic.-or- 0 (zero), to use the default encoding. |
T:System.ArgumentOutOfRangeException | codepage is less than zero or greater than 65535. |
T:System.ArgumentException | codepage is not supported by the underlying platform. |
T:System.NotSupportedException | codepage is not supported by the underlying platform. |
Definition at line 1249 of file Encoding.cs.
|
static |
Returns the encoding associated with the specified code page identifier. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded.
codepage | The code page identifier of the preferred encoding. Possible values are listed in the Code Page column of the table that appears in the T:System.Text.Encoding class topic.-or- 0 (zero), to use the default encoding. |
encoderFallback | An object that provides an error-handling procedure when a character cannot be encoded with the current encoding. |
decoderFallback | An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding. |
T:System.ArgumentOutOfRangeException | codepage is less than zero or greater than 65535. |
T:System.ArgumentException | codepage is not supported by the underlying platform. |
T:System.NotSupportedException | codepage is not supported by the underlying platform. |
Definition at line 1331 of file Encoding.cs.
|
static |
Returns the encoding associated with the specified code page name.
name | The code page name of the preferred encoding. Any value returned by the P:System.Text.Encoding.WebName property is valid. Possible values are listed in the Name column of the table that appears in the T:System.Text.Encoding class topic. |
T:System.ArgumentException | name is not a valid code page name.-or- The code page indicated by name is not supported by the underlying platform. |
Definition at line 1415 of file Encoding.cs.
|
static |
Returns the encoding associated with the specified code page name. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded.
name | The code page name of the preferred encoding. Any value returned by the P:System.Text.Encoding.WebName property is valid. Possible values are listed in the Name column of the table that appears in the T:System.Text.Encoding class topic. |
encoderFallback | An object that provides an error-handling procedure when a character cannot be encoded with the current encoding. |
decoderFallback | An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding. |
T:System.ArgumentException | name is not a valid code page name.-or- The code page indicated by name is not supported by the underlying platform. |
Definition at line 1433 of file Encoding.cs.
|
static |
Returns an array that contains all encodings.
Definition at line 1445 of file Encoding.cs.
override int System.Text.Encoding.GetHashCode | ( | ) |
Returns the hash code for the current instance.
Definition at line 2056 of file Encoding.cs.
|
pure virtual |
When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters.
charCount | The number of characters to encode. |
T:System.ArgumentOutOfRangeException | charCount is less than zero. |
T:System.Text.EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.EncoderFallback is set to T:System.Text.EncoderExceptionFallback. |
Implemented in System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, System.Text.UTF7Encoding, and System.Text.ASCIIEncoding.
|
pure virtual |
When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes.
byteCount | The number of bytes to decode. |
T:System.ArgumentOutOfRangeException | byteCount is less than zero. |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Implemented in System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, System.Text.UTF7Encoding, and System.Text.ASCIIEncoding.
|
virtual |
When overridden in a derived class, returns a sequence of bytes that specifies the encoding used.
Reimplemented in System.Text.UTF8Encoding, System.Text.UnicodeEncoding, and System.Text.UTF32Encoding.
Definition at line 1453 of file Encoding.cs.
unsafe string System.Text.Encoding.GetString | ( | byte * | bytes, |
int | byteCount | ||
) |
When overridden in a derived class, decodes a specified number of bytes starting at a specified address into a string.
bytes | A pointer to a byte array. |
byteCount | The number of bytes to decode. |
T:System.ArgumentNullException | bytes is a null pointer. |
T:System.ArgumentOutOfRangeException | byteCount is less than zero. |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for a complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Definition at line 1918 of file Encoding.cs.
|
virtual |
When overridden in a derived class, decodes all the bytes in the specified byte array into a string.
bytes | The byte array containing the sequence of bytes to decode. |
T:System.ArgumentException | The byte array contains invalid Unicode code points. |
T:System.ArgumentNullException | bytes is null . |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Definition at line 2006 of file Encoding.cs.
|
virtual |
When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a string.
bytes | The byte array containing the sequence of bytes to decode. |
index | The index of the first byte to decode. |
count | The number of bytes to decode. |
T:System.ArgumentException | The byte array contains invalid Unicode code points. |
T:System.ArgumentNullException | bytes is null . |
T:System.ArgumentOutOfRangeException | index or count is less than zero.-or- index and count do not denote a valid range in bytes . |
T:System.Text.DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and- P:System.Text.Encoding.DecoderFallback is set to T:System.Text.DecoderExceptionFallback. |
Reimplemented in System.Text.UTF7Encoding, System.Text.UTF8Encoding, System.Text.UnicodeEncoding, System.Text.UTF32Encoding, and System.Text.ASCIIEncoding.
Definition at line 2029 of file Encoding.cs.
bool System.Text.Encoding.IsAlwaysNormalized | ( | ) |
Gets a value indicating whether the current encoding is always normalized, using the default normalization form.
true
if the current T:System.Text.Encoding is always normalized; otherwise, false
. The default is false
.Definition at line 1935 of file Encoding.cs.
|
virtual |
When overridden in a derived class, gets a value indicating whether the current encoding is always normalized, using the specified normalization form.
form | One of the T:System.Text.NormalizationForm values. |
true
if the current T:System.Text.Encoding object is always normalized using the specified T:System.Text.NormalizationForm value; otherwise, false
. The default is false
.Definition at line 1945 of file Encoding.cs.
|
static |
Registers an encoding provider.
provider | A subclass of T:System.Text.EncodingProvider that provides access to additional character encodings. |
T:System.ArgumentNullException | provider is null . |
Definition at line 1233 of file Encoding.cs.
|
staticget |
Gets an encoding for the ASCII (7-bit) character set.
Definition at line 920 of file Encoding.cs.
|
staticget |
Gets an encoding for the UTF-16 format that uses the big endian byte order.
Definition at line 991 of file Encoding.cs.
|
get |
When overridden in a derived class, gets a name for the current encoding that can be used with mail agent body tags.
Definition at line 709 of file Encoding.cs.
|
get |
When overridden in a derived class, gets the code page identifier of the current T:System.Text.Encoding.
Definition at line 948 of file Encoding.cs.
|
getset |
Gets or sets the T:System.Text.DecoderFallback object for the current T:System.Text.Encoding object.
T:System.ArgumentNullException | The value in a set operation is null . |
T:System.InvalidOperationException | A value cannot be assigned in a set operation because the current T:System.Text.Encoding object is read-only. |
Definition at line 884 of file Encoding.cs.
|
staticget |
Gets an encoding for the operating system's current ANSI code page.
Definition at line 959 of file Encoding.cs.
|
getset |
Gets or sets the T:System.Text.EncoderFallback object for the current T:System.Text.Encoding object.
T:System.ArgumentNullException | The value in a set operation is null . |
T:System.InvalidOperationException | A value cannot be assigned in a set operation because the current T:System.Text.Encoding object is read-only. |
Definition at line 857 of file Encoding.cs.
|
get |
When overridden in a derived class, gets the human-readable description of the current encoding.
Definition at line 724 of file Encoding.cs.
|
get |
When overridden in a derived class, gets a name for the current encoding that can be used with mail agent header tags.
Definition at line 735 of file Encoding.cs.
|
get |
When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for displaying content.
true
if the current T:System.Text.Encoding can be used by browser clients for displaying content; otherwise, false
.Definition at line 780 of file Encoding.cs.
|
get |
When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for saving content.
true
if the current T:System.Text.Encoding can be used by browser clients for saving content; otherwise, false
.Definition at line 795 of file Encoding.cs.
|
get |
When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
true
if the current T:System.Text.Encoding can be used by mail and news clients for displaying content; otherwise, false
.Definition at line 810 of file Encoding.cs.
|
get |
When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
true
if the current T:System.Text.Encoding can be used by mail and news clients for saving content; otherwise, false
.Definition at line 825 of file Encoding.cs.
|
get |
When overridden in a derived class, gets a value indicating whether the current encoding is read-only.
true
if the current T:System.Text.Encoding is read-only; otherwise, false
. The default is true
.Definition at line 909 of file Encoding.cs.
|
get |
When overridden in a derived class, gets a value indicating whether the current encoding uses single-byte code points.
true
if the current T:System.Text.Encoding uses single-byte code points; otherwise, false
.Definition at line 842 of file Encoding.cs.
|
staticget |
Gets an encoding for the UTF-16 format using the little endian byte order.
Definition at line 975 of file Encoding.cs.
|
staticget |
Gets an encoding for the UTF-32 format using the little endian byte order.
Definition at line 1039 of file Encoding.cs.
|
staticget |
Gets an encoding for the UTF-7 format.
Definition at line 1007 of file Encoding.cs.
|
staticget |
Gets an encoding for the UTF-8 format.
Definition at line 1023 of file Encoding.cs.
|
get |
When overridden in a derived class, gets the name registered with the Internet Assigned Numbers Authority (IANA) for the current encoding.
Definition at line 750 of file Encoding.cs.
|
get |
When overridden in a derived class, gets the Windows operating system code page that most closely corresponds to the current encoding.
Definition at line 765 of file Encoding.cs.