public virtual Encoding GetEncoding(int codepage, EncoderFallback encoderFallback, DecoderFallback decoderFallback) { Encoding enc = GetEncoding(codepage); if (enc != null) { enc = (Encoding)GetEncoding(codepage).Clone(); enc.EncoderFallback = encoderFallback; enc.DecoderFallback = decoderFallback; } return(enc); }
internal static Encoding GetEncodingFromProvider(string encodingName, EncoderFallback enc, DecoderFallback dec) { if (_providers == null) { return(null); } EncodingProvider[] providers = _providers; foreach (EncodingProvider provider in providers) { Encoding encoding = provider.GetEncoding(encodingName, enc, dec); if (encoding != null) { return(encoding); } } return(null); }