private void AppendValueChar (int ch)
{
//See http://www.faqs.org/rfcs/rfc2781.html for used algorithm
if (ch < 0x10000) {
valueBuffer.Append ((char) ch);
return;
}
if (ch > 0x10FFFF)
throw new XmlException ("The numeric entity value is too large", null, LineNumber, LinePosition);
else
{
int utag = ch - 0x10000;
valueBuffer.Append((char) ((utag >> 10) + 0xD800));
valueBuffer.Append((char) ((utag & 0x3FF) + 0xDC00));
}
}