This documentation is archived and is not being maintained.

XmlTextReader.Encoding Property

Gets the encoding of the document.

[Visual Basic]
Public ReadOnly Property Encoding As Encoding
public Encoding Encoding {get;}
public: __property Encoding* get_Encoding();
public function get Encoding() : Encoding;

Property Value

The encoding value. If no encoding attribute exists, and there is no byte-order mark, this defaults to UTF-8.


Because XmlTextReader uses the System.Text.Encoding class, XmlTextReader also supports all encodings supported by that class. The exception to this is any encoding, such as UTF-7 or EBCDIC, that maps the <?xml sequence to different byte values than UTF-8.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlTextReader Class | XmlTextReader Members | System.Xml Namespace