Class EncodingOptionsExtensions
- Namespace
- Cuemon.Extensions.Text
- Assembly
- Cuemon.Extensions.Text.dll
Extension methods for the IEncodingOptions interface.
public static class EncodingOptionsExtensions
- Inheritance
-
ObjectEncodingOptionsExtensions
Methods
DetectUnicodeEncoding(IEncodingOptions, Byte[])
Tries to detect an System.Text.Encoding object from the specified bytes
.
If unsuccessful, the Encoding value is returned.
public static Encoding DetectUnicodeEncoding(this IEncodingOptions options, byte[] bytes)
Parameters
options
IEncodingOptionsThe IEncodingOptions to extend.
bytes
Byte[]The System.Byte array to parse for an System.Text.Encoding.
Returns
- Encoding
Either the detected encoding of
bytes
or the encoding of this instance.
DetectUnicodeEncoding(IEncodingOptions, Stream)
Tries to detect an System.Text.Encoding object from the specified stream
.
If unsuccessful, the Encoding value is returned.
public static Encoding DetectUnicodeEncoding(this IEncodingOptions options, Stream stream)
Parameters
options
IEncodingOptionsThe IEncodingOptions to extend.
stream
StreamThe System.IO.Stream to parse for an System.Text.Encoding.
Returns
- Encoding
Either the detected encoding of
stream
or the encoding of this instance.