TextEncodingConverterGetEncoding(String, EncoderFallback, DecoderFallback, Boolean) Method
Namespace: FolkerKinzel.StringsAssembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
public static Encoding GetEncoding(
string? encodingWebName,
EncoderFallback encoderFallback,
DecoderFallback decoderFallback,
bool throwOnInvalidWebName = false
)
Public Shared Function GetEncoding (
encodingWebName As String,
encoderFallback As EncoderFallback,
decoderFallback As DecoderFallback,
Optional throwOnInvalidWebName As Boolean = false
) As Encoding
public:
static Encoding^ GetEncoding(
String^ encodingWebName,
EncoderFallback^ encoderFallback,
DecoderFallback^ decoderFallback,
bool throwOnInvalidWebName = false
)
static member GetEncoding :
encodingWebName : string *
encoderFallback : EncoderFallback *
decoderFallback : DecoderFallback *
?throwOnInvalidWebName : bool
(* Defaults:
let _throwOnInvalidWebName = defaultArg throwOnInvalidWebName false
*)
-> Encoding
- encodingWebName String
- The identifier of the character set.
- encoderFallback EncoderFallback
- An object that provides an error handling mechanism
if a character cannot be encoded with the Encoding object.
- decoderFallback DecoderFallback
- An object that provides an error handling mechanism
if a Byte sequence cannot be decoded with the Encoding object .
- throwOnInvalidWebName Boolean (Optional)
- Pass true to have the method throw an
ArgumentException if encodingWebName could not
be converted.
EncodingAn
Encoding object that corresponds to the specified identifier
of a character set and whose properties
EncoderFallback and
DecoderFallback are set to the desired values. If no match
is found, a corresponding
Encoding object for UTF-8
is returned by default. If the method is called with
true as an argument for
the
throwOnInvalidWebName parameter, an
ArgumentException will be thrown instead.
.NET Standard and .NET 5.0 or higher recognize by default only a small number
of character sets. The method overrides this default setting.