Inheritance: System.Text.Encoding
        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;
        }
示例#2
0
        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);
        }
示例#3
0
        internal static Encoding MakeNonThrowing()
        {
            Encoding enc;

#if FEATURE_ENCODING
            enc = new PythonAsciiEncoding(new NonStrictEncoderFallback(), new NonStrictDecoderFallback());
#else
            enc = new PythonAsciiEncoding();
#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);
        }
 public PythonAsciiDecoder(PythonAsciiEncoding encoding)
 {
     _encoding     = encoding;
     this.Fallback = encoding.DecoderFallback;
 }