Caution
0 is treated as an invalid argument. This behavior is different from that
of the Encoding class.
public static bool TryGetEncoding(
int codePage,
out Encoding?? encoding
)Public Shared Function TryGetEncoding (
codePage As Integer,
<OutAttribute> ByRef encoding As Encoding
) As Booleanpublic:
static bool TryGetEncoding(
int codePage,
[OutAttribute] Encoding^% encoding
)static member TryGetEncoding :
codePage : int *
encoding : Encoding byref -> bool The code page number.
.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.