Class XmlEncodingUtility
This utility class is designed to make XML System.Text.Encoding operations easier to work with.
Inheritance
Namespace: Cuemon.Xml
Assembly: Cuemon.Xml.dll
Syntax
public static class XmlEncodingUtility
Methods
| Improve this DocReadEncoding(Stream)
Reads the System.Text.Encoding from the specified XML System.IO.Stream. If an encoding cannot be resolved, UTF-8 encoding is assumed for the System.Text.Encoding.
Declaration
public static Encoding ReadEncoding(Stream value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | value | The System.IO.Stream to resolve an System.Text.Encoding object from. |
Returns
| Type | Description |
|---|---|
| System.Text.Encoding | An System.Text.Encoding object equivalent to the encoding used in the |
ReadEncoding(Stream, Encoding)
Reads the System.Text.Encoding from the specified XML System.IO.Stream. If an encoding cannot be resolved, defaultEncoding encoding is assumed for the System.Text.Encoding.
Declaration
public static Encoding ReadEncoding(Stream value, Encoding defaultEncoding)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | value | The System.IO.Stream to resolve an System.Text.Encoding object from. |
| System.Text.Encoding | defaultEncoding | The preferred default System.Text.Encoding to use if an encoding cannot be resolved automatically. |
Returns
| Type | Description |
|---|---|
| System.Text.Encoding | An System.Text.Encoding object equivalent to the encoding used in the |