Table of Contents

Class EncodingOptionsExtensions

Namespace
Cuemon.Extensions.Text
Assembly
Cuemon.Extensions.Text.dll

Extension methods for the IEncodingOptions interface.

public static class EncodingOptionsExtensions
Inheritance
Object
EncodingOptionsExtensions

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 IEncodingOptions

The 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 IEncodingOptions

The IEncodingOptions to extend.

stream Stream

The System.IO.Stream to parse for an System.Text.Encoding.

Returns

Encoding

Either the detected encoding of stream or the encoding of this instance.