System.Text.ISO2022Encoding.GetChars C# (CSharp) Method

GetChars() private method

private GetChars ( byte bytes, int byteCount, char chars, int charCount, DecoderNLS baseDecoder ) : int
bytes byte
byteCount int
chars char
charCount int
baseDecoder DecoderNLS
return int
        public unsafe override int GetChars(byte* bytes, int byteCount,
                                                char* chars, int charCount, DecoderNLS baseDecoder)
        {
            // Just need to ASSERT, this is called by something else internal that checked parameters already
            Debug.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null");
            Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative");
            Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative");

            // Fix our decoder
            ISO2022Decoder decoder = (ISO2022Decoder)baseDecoder;
            int iCount = 0;

            switch (CodePage)
            {
                case 50220:
                case 50221:
                case 50222:
                    iCount = GetCharsCP5022xJP(bytes, byteCount, chars, charCount, decoder);
                    break;
                case 50225:
                    iCount = GetCharsCP50225KR(bytes, byteCount, chars, charCount, decoder);
                    break;
                // Currently 50227 is the same as 936
                //                case 50227:
                //                  iCount = GetCharsCP50227CN( bytes, byteCount, chars, charCount, decoder);
                //                break;
                case 52936:
                    iCount = GetCharsCP52936(bytes, byteCount, chars, charCount, decoder);
                    break;
                default:
                    Debug.Fail("[ISO2022Encoding.GetChars] had unexpected code page");
                    break;
            }

            return iCount;
        }