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

◆ InternalFallback() [2/2]

unsafe bool System.Text.DecoderFallbackBufferHelper.InternalFallback ( byte[] bytes,
byte * pBytes,
ref char * chars )
inlinepackage

Definition at line 30 of file DecoderFallbackBufferHelper.cs.

31 {
32 if (_fallbackBuffer.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length)))
33 {
34 char* ptr = chars;
35 bool flag = false;
36 char nextChar;
37 while ((nextChar = _fallbackBuffer.GetNextChar()) != 0)
38 {
39 if (char.IsSurrogate(nextChar))
40 {
41 if (char.IsHighSurrogate(nextChar))
42 {
43 if (flag)
44 {
46 }
47 flag = true;
48 }
49 else
50 {
51 if (!flag)
52 {
54 }
55 flag = false;
56 }
57 }
58 if (ptr >= charEnd)
59 {
60 return false;
61 }
62 *(ptr++) = nextChar;
63 }
64 if (flag)
65 {
67 }
68 chars = ptr;
69 }
70 return true;
71 }
static string Argument_InvalidCharSequenceNoIndex
Definition SR.cs:92
Definition SR.cs:7
bool Fallback(byte[] bytesUnknown, int index)

References System.Text.DecoderFallbackBufferHelper._fallbackBuffer, System.SR.Argument_InvalidCharSequenceNoIndex, System.bytes, System.Text.DecoderFallbackBufferHelper.byteStart, System.Text.DecoderFallbackBufferHelper.charEnd, System.chars, System.Text.DecoderFallbackBuffer.Fallback(), and System.Text.DecoderFallbackBuffer.GetNextChar().

Referenced by System.Text.EncodingCharBuffer.Fallback(), System.Text.DBCSCodePageEncoding.GetCharCount(), System.Text.SBCSCodePageEncoding.GetCharCount(), System.Text.DBCSCodePageEncoding.GetChars(), and System.Text.SBCSCodePageEncoding.GetChars().