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

◆ EncodeSurrogate()

static unsafe byte * System.Xml.XmlUtf8RawTextWriter.EncodeSurrogate ( char * pSrc,
char * pSrcEnd,
byte * pDst )
inlinestaticprivateinherited

Definition at line 1137 of file XmlUtf8RawTextWriter.cs.

1138 {
1139 int num = *pSrc;
1140 if (num <= 56319)
1141 {
1142 if (pSrc + 1 < pSrcEnd)
1143 {
1144 int num2 = pSrc[1];
1146 {
1147 num = XmlCharType.CombineSurrogateChar(num2, num);
1148 *pDst = (byte)(0xF0u | (uint)(num >> 18));
1149 pDst[1] = (byte)(0x80u | ((uint)(num >> 12) & 0x3Fu));
1150 pDst[2] = (byte)(0x80u | ((uint)(num >> 6) & 0x3Fu));
1151 pDst[3] = (byte)(0x80u | ((uint)num & 0x3Fu));
1152 pDst += 4;
1153 return pDst;
1154 }
1155 throw XmlConvert.CreateInvalidSurrogatePairException((char)num2, (char)num);
1156 }
1158 }
1159 throw XmlConvert.CreateInvalidHighSurrogateCharException((char)num);
1160 }
static string Xml_InvalidSurrogateMissingLowChar
Definition SR.cs:324
Definition SR.cs:7

References System.Xml.ArgumentException, System.Xml.XmlCharType.CombineSurrogateChar(), System.Xml.XmlConvert.CreateInvalidHighSurrogateCharException(), System.Xml.XmlConvert.CreateInvalidSurrogatePairException(), System.Xml.Dictionary, System.LocalAppContextSwitches.DontThrowOnInvalidSurrogatePairs, and System.SR.Xml_InvalidSurrogateMissingLowChar.

Referenced by System.Xml.XmlUtf8RawTextWriter.CharToUTF8(), System.Xml.XmlUtf8RawTextWriter.EncodeChar(), System.Xml.XmlUtf8RawTextWriter.RawText(), System.Xml.XmlUtf8RawTextWriter.RawTextNoFlush(), System.Xml.XmlUtf8RawTextWriter.WriteAttributeTextBlock(), System.Xml.XmlUtf8RawTextWriter.WriteAttributeTextBlockNoFlush(), System.Xml.XmlUtf8RawTextWriter.WriteCDataSection(), System.Xml.XmlUtf8RawTextWriter.WriteCDataSectionNoFlush(), System.Xml.XmlUtf8RawTextWriter.WriteCommentOrPi(), System.Xml.XmlUtf8RawTextWriter.WriteCommentOrPiNoFlush(), System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(), System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlockNoFlush(), System.Xml.XmlUtf8RawTextWriter.WriteRawWithCharChecking(), and System.Xml.XmlUtf8RawTextWriter.WriteRawWithCharCheckingNoFlush().