Table of Contents

TryDetectUnicodeEncoding Method

Definition

Namespace
Cuemon.Extensions.IO
Assemblies
Cuemon.Extensions.IO.dll
Source
src/Cuemon.Extensions.IO/StreamExtensions.cs

TryDetectUnicodeEncoding(Stream, out Encoding)

Tries to resolve the Unicode Encoding object from the specified Stream object.

public static bool TryDetectUnicodeEncoding(this Stream value, out Encoding result)

Parameters

value Stream

The Stream to extend.

result Encoding

When this method returns, it contains the Unicode Encoding value equivalent to the encoding contained in value, if the conversion succeeded, or a null reference (Nothing in Visual Basic) if the conversion failed. The conversion fails if the value parameter is null, or does not contain a Unicode representation of an Encoding.

Returns

bool

true if the value parameter was converted successfully; otherwise, false.