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
EncodingOptionsExtensions

Methods

DetectUnicodeEncoding(IEncodingOptions, Byte[])

Tries to detect an 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 Byte array to parse for an Encoding.

Returns

Encoding

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

DetectUnicodeEncoding(IEncodingOptions, Stream)

Tries to detect an 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 Stream to parse for an Encoding.

Returns

Encoding

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