public static string HexEscape(char character)
{
if (character > '\xff')
{
throw new ArgumentOutOfRangeException(nameof(character));
}
char[] chars = new char[3];
int pos = 0;
UriHelper.EscapeAsciiChar(character, chars, ref pos);
return new string(chars);
}