97 932, 932, 932, 0, 0, 949, 936, 0, 0, 0,
103 41379, 41430, 41431, 41378, 41382, 42482, 42401, 42403, 42405, 42407,
104 42409, 42467, 42469, 42471, 42435, 41404, 42402, 42404, 42406, 42408,
105 42410, 42411, 42413, 42415, 42417, 42419, 42421, 42423, 42425, 42427,
106 42429, 42431, 42433, 42436, 42438, 42440, 42442, 42443, 42444, 42445,
107 42446, 42447, 42450, 42453, 42456, 42459, 42462, 42463, 42464, 42465,
108 42466, 42468, 42470, 42472, 42473, 42474, 42475, 42476, 42477, 42479,
142 else if (
bytes == 64088)
146 else if (
bytes == 64089)
150 else if (
bytes == 64090)
154 else if (
bytes == 64091)
161 byte b = (byte)
bytes;
166 else if (b >= 128 && b <= 155)
176 byte b2 = (byte)(
bytes >> 8);
177 byte b3 = (byte)
bytes;
178 b2 = (byte)(b2 - ((b2 > 159) ? 177 : 113));
179 b2 = (byte)((b2 << 1) + 1);
193 bytes = (b2 << 8) | b3;
212 if (
bytes >= 256 && ((
bytes & 0xFF) < 161 || (
bytes & 0xFF) == 255 || (
bytes & 0xFF00) < 41216 || (
bytes & 0xFF00) == 65280))
290 if (charLeftOver >
'\0')
292 encodingByteBuffer.Fallback(charLeftOver);
303 b = (byte)(num >> 8);
304 b2 = (byte)(num & 0xFFu);
324 if (!encodingByteBuffer.
AddByte(15))
328 iSO2022Modes = iSO2022Modes2;
332 if (!encodingByteBuffer.
AddByte((
byte)27, (byte)36, (
byte)66))
338 if (!encodingByteBuffer.
AddByte(b, b2))
343 else if (num != 0 || nextChar ==
'\0')
347 if (!encodingByteBuffer.
AddByte(15))
351 iSO2022Modes = iSO2022Modes2;
355 if (!encodingByteBuffer.
AddByte((
byte)27, (byte)40, (
byte)66))
361 if (!encodingByteBuffer.
AddByte(b2))
368 encodingByteBuffer.Fallback(nextChar);
372 encodingByteBuffer.Fallback(nextChar);
375 if (iSO2022Modes != 0)
379 if (!encodingByteBuffer.
AddByte(14))
383 iSO2022Modes2 = iSO2022Modes;
388 if (!encodingByteBuffer.
AddByte((
byte)27, (byte)40, (
byte)73))
395 if (!encodingByteBuffer.
AddByte((
byte)(b2 & 0x7Fu)))
404 if (encodingByteBuffer.
AddByte(15))
406 iSO2022Modes = iSO2022Modes2;
415 if (encodingByteBuffer.
AddByte((
byte)27, (byte)40, (
byte)66))
425 if (
bytes !=
null && encoder !=
null)
427 encoder.currentMode = iSO2022Modes;
428 encoder.shiftInOutMode = iSO2022Modes2;
429 if (!encodingByteBuffer.fallbackBufferHelper.bUsedEncoder)
431 encoder.charLeftOver =
'\0';
433 encoder.m_charsUsed = encodingByteBuffer.
CharsUsed;
435 return encodingByteBuffer.
Count;
448 if (charLeftOver >
'\0')
450 encodingByteBuffer.Fallback(charLeftOver);
457 byte b = (byte)(num >> 8);
458 byte b2 = (byte)(num & 0xFFu);
463 if (!encodingByteBuffer.
AddByte((
byte)27, (byte)36, (
byte)41, (byte)67))
471 if (!encodingByteBuffer.
AddByte(14))
477 if (!encodingByteBuffer.
AddByte(b, b2))
482 else if (num != 0 || nextChar ==
'\0')
486 if (!encodingByteBuffer.
AddByte(15))
492 if (!encodingByteBuffer.
AddByte(b2))
499 encodingByteBuffer.Fallback(nextChar);
504 if (encodingByteBuffer.
AddByte(15))
513 if (
bytes !=
null && encoder !=
null)
515 if (!encodingByteBuffer.fallbackBufferHelper.bUsedEncoder)
517 encoder.charLeftOver =
'\0';
519 encoder.currentMode = iSO2022Modes;
522 encoder.shiftInOutMode = iSO2022Modes2;
528 encoder.m_charsUsed = encodingByteBuffer.
CharsUsed;
530 return encodingByteBuffer.
Count;
541 if (charLeftOver >
'\0')
543 encodingByteBuffer.Fallback(charLeftOver);
550 if (num == 0 && nextChar != 0)
552 encodingByteBuffer.Fallback(nextChar);
555 byte b = (byte)(num >> 8);
556 byte b2 = (byte)(num & 0xFFu);
557 if ((b != 0 && (b < 161 || b > 247 || b2 < 161 || b2 > 254)) || (b == 0 && b2 > 128 && b2 !=
byte.MaxValue))
559 encodingByteBuffer.Fallback(nextChar);
566 if (!encodingByteBuffer.
AddByte(126, 123, 2))
572 if (encodingByteBuffer.
AddByte((
byte)(b & 0x7Fu), (
byte)(b2 & 0x7Fu)))
580 if (!encodingByteBuffer.
AddByte(126, 125, (b2 != 126) ? 1 : 2))
586 if ((b2 == 126 && !encodingByteBuffer.
AddByte(126, 1)) || !encodingByteBuffer.
AddByte(b2))
593 if (encodingByteBuffer.
AddByte((
byte)126, (byte)125))
602 if (encoder !=
null &&
bytes !=
null)
604 encoder.currentMode = iSO2022Modes;
605 if (!encodingByteBuffer.fallbackBufferHelper.bUsedEncoder)
607 encoder.charLeftOver =
'\0';
609 encoder.m_charsUsed = encodingByteBuffer.
CharsUsed;
611 return encodingByteBuffer.
Count;
619 byte[] bytes2 =
new byte[4];
626 for (
int i = 0; i <
count; i++)
640 if (decoder !=
null && !decoder.
MustFlush)
649 switch (iSO2022Modes3)
653 iSO2022Modes = (iSO2022Modes2 = iSO2022Modes3);
681 iSO2022Modes2 = iSO2022Modes;
685 iSO2022Modes = iSO2022Modes2;
705 if (decoder ==
null || decoder.
MustFlush)
709 else if (
chars !=
null)
720 if (flag && (num & 0xFF00) == 10752)
722 num = (ushort)(num & 0xFFu);
723 num = (ushort)(num | 0x1000u);
726 else if (num >= 161 && num <= 223)
728 num = (ushort)(num | 0x1000u);
729 num = (ushort)(num & 0xFF7Fu);
731 else if (iSO2022Modes ==
ISO2022Modes.ModeHalfwidthKatakana)
733 num = (ushort)(num | 0x1000u);
736 if (c ==
'\0' && num != 0)
740 if (!encodingCharBuffer.
Fallback((
byte)(num >> 8), (
byte)num))
745 else if (!encodingCharBuffer.
Fallback(b))
750 else if (!encodingCharBuffer.
AddChar(c, (!flag) ? 1 : 2))
755 if (
chars !=
null && decoder !=
null)
759 decoder.currentMode = iSO2022Modes;
760 decoder.shiftInOutMode = iSO2022Modes2;
761 decoder.bytesLeftOverCount =
count;
762 decoder.bytesLeftOver = bytes2;
768 decoder.bytesLeftOverCount = 0;
770 decoder.m_bytesUsed = encodingCharBuffer.
BytesUsed;
772 return encodingCharBuffer.
Count;
804 else if (
bytes[1] == 36)
829 byte result =
bytes[0];
830 for (
int i = 0; i <
count; i++)
842 byte[] bytes2 =
new byte[4];
848 for (
int i = 0; i <
count; i++)
862 if (decoder !=
null && !decoder.
MustFlush)
909 if (iSO2022Modes ==
ISO2022Modes.ModeKR && b != 32 && b != 9 && b != 10)
924 if (decoder ==
null || decoder.
MustFlush)
928 else if (
chars !=
null)
941 if (c ==
'\0' && num != 0)
945 if (!encodingCharBuffer.
Fallback((
byte)(num >> 8), (
byte)num))
950 else if (!encodingCharBuffer.
Fallback(b))
955 else if (!encodingCharBuffer.
AddChar(c, (!flag) ? 1 : 2))
960 if (
chars !=
null && decoder !=
null)
964 decoder.currentMode = iSO2022Modes;
965 decoder.bytesLeftOverCount =
count;
966 decoder.bytesLeftOver = bytes2;
972 decoder.bytesLeftOverCount = 0;
974 decoder.m_bytesUsed = encodingCharBuffer.
BytesUsed;
976 return encodingCharBuffer.
Count;
1002 if (decoder !=
null)
1010 while (encodingCharBuffer.
MoreData || num >= 0)
1026 if (decoder ==
null || decoder.
MustFlush)
1034 decoder.bytesLeftOverCount = 1;
1041 if (b == 126 && iSO2022Modes ==
ISO2022Modes.ModeASCII)
1043 if (!encodingCharBuffer.
AddChar((
char)b, 2))
1070 if (decoder ==
null || decoder.
MustFlush)
1078 decoder.bytesLeftOverCount = 1;
1085 ushort num2 = (ushort)((b << 8) | nextByte);
1087 if (b == 32 && nextByte != 0)
1093 if ((b < 33 || b > 119 || nextByte < 33 || nextByte > 126) && (b < 161 || b > 247 || nextByte < 161 || nextByte > 254))
1095 if (nextByte != 32 || 33 > b || b > 125)
1097 if (!encodingCharBuffer.
Fallback((
byte)(num2 >> 8), (
byte)num2))
1105 num2 = (ushort)(num2 | 0x8080u);
1108 if (c ==
'\0' && num2 != 0)
1110 if (!encodingCharBuffer.
Fallback((
byte)(num2 >> 8), (
byte)num2))
1115 else if (!encodingCharBuffer.
AddChar(c, 2))
1122 if ((c2 ==
'\0' || c2 ==
'\0') && b != 0)
1124 if (!encodingCharBuffer.
Fallback(b))
1129 else if (!encodingCharBuffer.
AddChar(c2))
1134 if (
chars !=
null && decoder !=
null)
1138 decoder.bytesLeftOverCount = 0;
1146 decoder.currentMode = iSO2022Modes;
1148 decoder.m_bytesUsed = encodingCharBuffer.
BytesUsed;
1150 return encodingCharBuffer.
Count;
1160 if (base.EncoderFallback.MaxCharCount > 1)
1162 num *= base.EncoderFallback.MaxCharCount;
1190 if (num >
int.MaxValue)
1219 long num3 = (long)
byteCount * (
long)num + num2;
1220 if (base.DecoderFallback.MaxCharCount > 1)
1222 num3 *= base.DecoderFallback.MaxCharCount;
1224 if (num3 >
int.MaxValue)
static string ArgumentOutOfRange_GetCharCountOverflow
static string ArgumentOutOfRange_GetByteCountOverflow
static string ArgumentOutOfRange_NeedNonNegNum
unsafe char * mapBytesToUnicode
unsafe ushort * mapUnicodeToBytes
DecoderFallbackBuffer m_fallbackBuffer
EncoderFallbackBuffer m_fallbackBuffer
unsafe bool AddByte(byte b, int moreBytesExpected)
unsafe char GetNextChar()
unsafe byte GetNextByte()
unsafe bool AddChar(char ch, int numBytes)
bool Fallback(byte fallbackByte)
unsafe void AdjustBytes(int count)
ISO2022Modes shiftInOutMode
ISO2022Decoder(EncodingNLS encoding)
ISO2022Modes shiftInOutMode
ISO2022Encoder(EncodingNLS encoding)
unsafe override int GetBytes(char *chars, int charCount, byte *bytes, int byteCount, System.Text.EncoderNLS baseEncoder)
ISO2022Modes CheckEscapeSequenceKR(byte[] bytes, int escapeCount)
override bool CleanUpBytes(ref int bytes)
static readonly ushort[] s_HalfToFullWidthKanaTable
unsafe int GetBytesCP50225KR(char *chars, int charCount, byte *bytes, int byteCount, ISO2022Encoder encoder)
unsafe override int GetChars(byte *bytes, int byteCount, char *chars, int charCount, System.Text.DecoderNLS baseDecoder)
ISO2022Encoding(int codePage)
unsafe int GetBytesCP52936(char *chars, int charCount, byte *bytes, int byteCount, ISO2022Encoder encoder)
unsafe override int GetCharCount(byte *bytes, int count, System.Text.DecoderNLS baseDecoder)
override Decoder GetDecoder()
unsafe int GetCharsCP50225KR(byte *bytes, int byteCount, char *chars, int charCount, ISO2022Decoder decoder)
override int GetMaxByteCount(int charCount)
override Encoder GetEncoder()
unsafe int GetCharsCP52936(byte *bytes, int byteCount, char *chars, int charCount, ISO2022Decoder decoder)
override int GetMaxCharCount(int byteCount)
unsafe int GetCharsCP5022xJP(byte *bytes, int byteCount, char *chars, int charCount, ISO2022Decoder decoder)
ISO2022Modes CheckEscapeSequenceJP(byte[] bytes, int escapeCount)
unsafe override int GetByteCount(char *chars, int count, System.Text.EncoderNLS baseEncoder)
unsafe int GetBytesCP5022xJP(char *chars, int charCount, byte *bytes, int byteCount, ISO2022Encoder encoder)
byte DecrementEscapeBytes(ref byte[] bytes, ref int count)
static readonly int[] s_tableBaseCodePages