private static Encoding MakeSourceEncoding() { Encoding enc = new PythonAsciiEncoding(); #if FEATURE_ENCODING // we need to Clone the new instance here so that the base class marks us as non-readonly enc = (Encoding)enc.Clone(); enc.DecoderFallback = new SourceNonStrictDecoderFallback(); #endif return enc; }
private static Encoding MakeSourceEncoding() { Encoding enc = new PythonAsciiEncoding(); #if FEATURE_ENCODING // we need to Clone the new instance here so that the base class marks us as non-readonly enc = (Encoding)enc.Clone(); enc.DecoderFallback = new SourceNonStrictDecoderFallback(); #endif return(enc); }
internal static Encoding MakeNonThrowing() { Encoding enc = new PythonAsciiEncoding(); #if FEATURE_ENCODING // we need to Clone the new instance here so that the base class marks us as non-readonly enc = (Encoding)enc.Clone(); StringOps.SetDecoderFallback(enc, new NonStrictDecoderFallback()); StringOps.SetEncoderFallback(enc, new NonStrictEncoderFallback()); #endif return(enc); }