Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Text.​EncodingProvider
Assembly: System.Runtime
Inheritance: object → EncodingProvider
Provides the base class for an encoding provider, which supplies encodings that are unavailable on a particular platform.
Methods
public
Encoding
GetEncoding​(int codepage)
Returns the encoding associated with the specified code page identifier.
Returns The encoding that is associated with the specified code page, or <see langword="null" /> if this <see cref="T:System.Text.EncodingProvider" /> cannot return a valid encoding that corresponds to <paramref name="codepage" /> .
codepage
The code page identifier of the requested encoding.
public
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.
Returns The encoding that is associated with the specified code page, or <see langword="null" /> if this <see cref="T:System.Text.EncodingProvider" /> cannot return a valid encoding that corresponds to <paramref name="codepage" /> .
codepage
The code page identifier of the requested encoding.
encoderFallback
An object that provides an error-handling procedure when a character cannot be encoded with this encoding.
decoderFallback
An object that provides an error-handling procedure when a byte sequence cannot be decoded with this encoding.
public
Encoding
GetEncoding​(string name)
Returns the encoding with the specified name.
Returns The encoding that is associated with the specified name, or <see langword="null" /> if this <see cref="T:System.Text.EncodingProvider" /> cannot return a valid encoding that corresponds to <paramref name="name" /> .
name
The name of the requested encoding.
public
Encoding
GetEncoding​(string name,
EncoderFallback encoderFallback,
DecoderFallback decoderFallback)
Returns the encoding associated with the specified name. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded.
Returns The encoding that is associated with the specified name, or <see langword="null" /> if this <see cref="T:System.Text.EncodingProvider" /> cannot return a valid encoding that corresponds to <paramref name="name" /> .
name
The name of the preferred encoding.
encoderFallback
An object that provides an error-handling procedure when a character cannot be encoded with this encoding.
decoderFallback
An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding.
public
Collections.​Generic.​IEnumerable<​EncodingInfo>
GetEncodings​()
Returns an array that contains all the encodings that are supported by the <see cref="T:System.Text.EncodingProvider" /> .
Returns An array that contains all the supported encodings.
public
bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj
The object to compare with the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.