Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CheckEscapeSequenceJP()

ISO2022Modes System.Text.ISO2022Encoding.CheckEscapeSequenceJP ( byte[] bytes,
int escapeCount )
inlineprivate

Definition at line 775 of file ISO2022Encoding.cs.

776 {
777 if (bytes[0] != 27)
778 {
779 return ISO2022Modes.ModeInvalidEscape;
780 }
781 if (escapeCount < 3)
782 {
783 return ISO2022Modes.ModeIncompleteEscape;
784 }
785 if (bytes[1] == 40)
786 {
787 if (bytes[2] == 66)
788 {
789 return ISO2022Modes.ModeASCII;
790 }
791 if (bytes[2] == 72)
792 {
793 return ISO2022Modes.ModeASCII;
794 }
795 if (bytes[2] == 74)
796 {
797 return ISO2022Modes.ModeASCII;
798 }
799 if (bytes[2] == 73)
800 {
801 return ISO2022Modes.ModeHalfwidthKatakana;
802 }
803 }
804 else if (bytes[1] == 36)
805 {
806 if (bytes[2] == 64 || bytes[2] == 66)
807 {
808 return ISO2022Modes.ModeJIS0208;
809 }
810 if (escapeCount < 4)
811 {
812 return ISO2022Modes.ModeIncompleteEscape;
813 }
814 if (bytes[2] == 40 && bytes[3] == 68)
815 {
816 return ISO2022Modes.ModeJIS0208;
817 }
818 }
819 else if (bytes[1] == 38 && bytes[2] == 64)
820 {
821 return ISO2022Modes.ModeNOOP;
822 }
823 return ISO2022Modes.ModeInvalidEscape;
824 }

References System.bytes.

Referenced by System.Text.ISO2022Encoding.GetCharsCP5022xJP().