Table of Contents

DetectUnicodeEncoding Method

Definition

Namespace
Cuemon.Extensions.Text
Assemblies
Cuemon.Extensions.Text.dll
Source
src/Cuemon.Extensions.Text/EncodingOptionsExtensions.cs

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.

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.