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

◆ InternalFallback() [1/2]

virtual unsafe int System.Text.DecoderFallbackBuffer.InternalFallback ( byte[] bytes,
byte * pBytes )
inlinepackagevirtualinherited

Reimplemented in System.Text.DecoderReplacementFallbackBuffer, and System.Text.UTF7Encoding.DecoderUTF7FallbackBuffer.

Definition at line 96 of file DecoderFallbackBuffer.cs.

97 {
98 if (Fallback(bytes, (int)(pBytes - byteStart - bytes.Length)))
99 {
100 int num = 0;
101 bool flag = false;
102 char nextChar;
103 while ((nextChar = GetNextChar()) != 0)
104 {
105 if (char.IsSurrogate(nextChar))
106 {
107 if (char.IsHighSurrogate(nextChar))
108 {
109 if (flag)
110 {
111 throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
112 }
113 flag = true;
114 }
115 else
116 {
117 if (!flag)
118 {
119 throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
120 }
121 flag = false;
122 }
123 }
124 num++;
125 }
126 if (flag)
127 {
128 throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
129 }
130 return num;
131 }
132 return 0;
133 }
bool Fallback(byte[] bytesUnknown, int index)

References System.SR.Argument_InvalidCharSequenceNoIndex, System.bytes, System.Text.DecoderFallbackBuffer.byteStart, System.Text.DecoderFallbackBuffer.Fallback(), and System.Text.DecoderFallbackBuffer.GetNextChar().