TextEncodingConverterTryGetEncoding(String, Encoding) Method

Tries to return a corresponding Encoding object for the specified identifier of a character set.

Definition

Namespace: FolkerKinzel.Strings
Assembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.5.0+6287955de434d14f61638ea0c3c40b499ae05cd1
C#
public static bool TryGetEncoding(
	string? encodingWebName,
	out Encoding?? encoding
)

Parameters

encodingWebName  String
The identifier of the character set.
encoding  Encoding
When this method returns true, contains an Encoding object that matches the specified identifier of a character set, null otherwise. This parameter is passed uninitialized.

Return Value

Boolean
true if the conversion was successful, false otherwise.

Remarks

.NET Standard and .NET 5.0 or later only recognize a small number of character sets by default. The method overrides this default.

The properties EncoderFallback and DecoderFallback of the generated Encoding object are set to ReplacementFallback.

See Also