Class EncodingOptions
Specifies options that is related to Encoding operations.
Namespace: Cuemon.Text
Assembly: Cuemon.Core.dll
Syntax
public class EncodingOptions
Constructors
| Improve this DocEncodingOptions()
Initializes a new instance of the EncodingOptions class.
Declaration
public EncodingOptions()
Remarks
The following table shows the initial property values for an instance of EncodingOptions.
Property | Initial Value |
---|---|
Preamble | DefaultPreambleSequence |
Encoding | DefaultEncoding |
Properties
| Improve this DocDefaultEncoding
Gets or sets the default encoding of EncodingOptions. Default is System.Text.Encoding.UTF8.
Declaration
public static Encoding DefaultEncoding { get; set; }
Property Value
Type | Description |
---|---|
System.Text.Encoding | The default encoding to use in Encoding related operations. |
Remarks
Changing this value should be thought through carefully as it can change the behavior you have come to expect. Consider using local adjustment instead.
DefaultPreambleSequence
Gets or sets the default preamble action of EncodingOptions. Default is Remove.
Declaration
public static PreambleSequence DefaultPreambleSequence { get; set; }
Property Value
Type | Description |
---|---|
PreambleSequence | The default preamble action to use in Encoding related operations. |
Remarks
Changing this value should be thought through carefully as it can change the behavior you have come to expect. Consider using local adjustment instead.
Encoding
Gets or sets the encoding for the operation.
Declaration
public Encoding Encoding { get; set; }
Property Value
Type | Description |
---|---|
System.Text.Encoding | The encoding for the operation. |
Preamble
Gets or sets the action to take in regards to encoding related preamble sequences.
Declaration
public PreambleSequence Preamble { get; set; }
Property Value
Type | Description |
---|---|
PreambleSequence | A value that indicates whether to preserve or remove preamble sequences. |
Methods
| Improve this DocDetectEncoding(Byte[])
Tries to detect an System.Text.Encoding object from the specified value
. If unsuccessful, the encoding of this instance is returned.
Declaration
public Encoding DetectEncoding(byte[] value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | value | The System.Byte array to parse for an System.Text.Encoding. |
Returns
Type | Description |
---|---|
System.Text.Encoding | Either the detected encoding of |
DetectEncoding(Stream)
Tries to detect an System.Text.Encoding object from the specified value
. If unsuccessful, the encoding of this instance is returned.
Declaration
public Encoding DetectEncoding(Stream value)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | value | The System.IO.Stream to parse for an System.Text.Encoding. |
Returns
Type | Description |
---|---|
System.Text.Encoding | Either the detected encoding of |