static string EncodeCharacterToHtmlEntityEscape(char c)
{
// check for illegal characters
if((c <= 31 && c != '\t' && c != '\n' && c != '\r') || (c >= 127 && c <= 159))
return "�"; // Let's entity encode this instead of returning it
else
return c.ToString();
}