This documentation is archived and is not being maintained.

XmlValidatingReader.Encoding Property

Gets the encoding attribute for 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 not byte-order mark, this defaults to UTF-8.


When any external reference is read (such as expanding an entity in a DTD file or reading a schema file) the encoding property is set to the encoding value of the external reference. If encoding is not specified in the external reference, and there is no byte-order mark, this defaults to UTF-8.

All the encoding standards that the underlying operating system supports are supported.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

XmlValidatingReader Class | XmlValidatingReader Members | System.Xml Namespace