CurrentEncoding Property
Collapse the table of content
Expand the table of content

StreamReader.CurrentEncoding Property

 

Gets the current character encoding that the current StreamReader object is using.

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

abstract CurrentEncoding : Encoding with get
override CurrentEncoding : Encoding with get

Property Value

Type: System.Text.Encoding

The current character encoding used by the current reader. The value can be different after the first call to any Read method of StreamReader, since encoding autodetection is not done until the first call to a Read method.

For a list of common I/O tasks, see Common I/O Tasks.

The following code example gets the encoding of the specified StreamReader object.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft