Inheritance: ISerializable, IObjectReference
 internal MLangDecoder(MLangCodePageEncoding enc) : base()
 {
     m_encoding    = enc;
     m_codePage    = enc.CodePage;
     m_buffer      = new byte[enc.m_maxByteSize];
     m_bufferCount = 0;
     m_context     = 0;
 }
        private static Encoding GetEncodingRare(int codepage)
        {
            BCLDebug.Assert(codepage != 0 && codepage != 1200 && codepage != 1201 && codepage != 65001, "This code page (" + codepage + " isn't supported by GetEncodingRare!");
            Encoding result;

            switch (codepage)
            {
            case 1:
            case 2:
            case 3:
            case 42:
                // NOTENOTE YSLin:
                // Win32 also allows the following special code page values.  We won't allow them except in the
                // CP_ACP case.
                // #define CP_ACP                    0           // default to ANSI code page
                // #define CP_OEMCP                  1           // default to OEM  code page
                // #define CP_MACCP                  2           // default to MAC  code page
                // #define CP_THREAD_ACP             3           // current thread's ANSI code page
                // #define CP_SYMBOL                 42          // SYMBOL translations
                throw new ArgumentException(String.Format(Environment.GetResourceString("Argument_CodepageNotSupported"), codepage), "codepage");

            case 65000:
                result = UTF7;
                break;

            case 20127:
                result = ASCII;
                break;

            case ISO_8859_1:
                result = Latin1;
                break;

            case ISOKorean:
                result = new MLangCodePageEncoding(ISOKorean, ISOKorean_SIZE);
                break;

            case ChineseSimp:
                result = new MLangCodePageEncoding(ChineseSimp, ChineseSimp_SIZE);
                break;

            case ISCIIAsseme:
            case ISCIIBengali:
            case ISCIIDevanagari:
            case ISCIIGujarathi:
            case ISCIIKannada:
            case ISCIIMalayalam:
            case ISCIIOriya:
            case ISCIIPanjabi:
            case ISCIITamil:
            case ISCIITelugu:
                result = new MLangCodePageEncoding(codepage, ISCII_SIZE);
                break;

            case ISO2022JP:
                result = new MLangCodePageEncoding(ISO2022JP, ISO2022JP_SIZE);
                break;

            case ENC50221:
                result = new MLangCodePageEncoding(ENC50221, ENC50221_SIZE);
                break;

            case ENC50222:
                result = new MLangCodePageEncoding(ENC50222, ENC50222_SIZE);
                break;

            case ENC50227:
                result = new MLangCodePageEncoding(ENC50227, ENC50227_SIZE);
                break;

            case EUCJP:
                result = new MLangCodePageEncoding(EUCJP, EUCJP_SIZE);
                break;

            case GB18030:
                result = new GB18030Encoding();
                break;

            case EUCCN:
                result = new MLangCodePageEncoding(EUCCN, EUCCN_SIZE);
                break;

            case ENC50229:
                throw new NotSupportedException(Environment.GetResourceString("NotSupported_CodePage50229"));

            default:
                result = new CodePageEncoding(codepage);
                break;
            }
            return(result);
        }
 internal MLangEncoder(MLangCodePageEncoding enc) : base()
 {
     m_encoding = enc;
     m_codePage = enc.CodePage;
 }