XmlWriterSettings.Encoding Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the text encoding to use.
Assembly: System.Xml (in System.Xml.dll)
This property only applies to XmlWriter instances that output text content to a stream; otherwise, this setting is ignored. The XmlWriter encodes a buffer of characters at a time, rather than character by character. An exception is thrown when the Flush method is called if any encoding errors are encountered.
This property is overridden by the encoding of the underlying writer. For example, if this property is set to Unicode for a particular XmlWriter, but the underlying writer is a StreamWriter with encoding set to UTF8, the output will be UTF8 encoded.
Security Note: |
|---|
Do not accept an Encoding object from an untrusted source. |
Security Note: