static private CreateInvalidHighSurrogateCharException ( char hi, ExceptionType exceptionType, int lineNo, int linePos ) : |
||
hi | char | |
exceptionType | ExceptionType | |
lineNo | int | |
linePos | int | |
return |
internal static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType, int lineNo, int linePos)
{
return CreateException(SR.Xml_InvalidSurrogateHighChar, ((uint)hi).ToString("X", CultureInfo.InvariantCulture), exceptionType, lineNo, linePos);
}
XmlConvert::CreateInvalidHighSurrogateCharException ( char hi ) : |
|
XmlConvert::CreateInvalidHighSurrogateCharException ( char hi, ExceptionType exceptionType ) : |
private static unsafe byte *EncodeSurrogate(char *pSrc, char *pSrcEnd, byte *pDst) { int highChar = pSrc[0]; if (highChar > 0xdbff) { throw XmlConvert.CreateInvalidHighSurrogateCharException((char)highChar); } if ((pSrc + 1) >= pSrcEnd) { throw new ArgumentException(Res.GetString("Xml_InvalidSurrogateMissingLowChar")); } int lowChar = pSrc[1]; if (lowChar < 0xdc00) { throw XmlConvert.CreateInvalidSurrogatePairException((char)lowChar, (char)highChar); } highChar = XmlCharType.CombineSurrogateChar(lowChar, highChar); pDst[0] = (byte)(240 | (highChar >> 0x12)); pDst[1] = (byte)(0x80 | ((highChar >> 12) & 0x3f)); pDst[2] = (byte)(0x80 | ((highChar >> 6) & 0x3f)); pDst[3] = (byte)(0x80 | (highChar & 0x3f)); pDst += 4; return(pDst); }