[Modify] Add it

This commit is contained in:
sta 2018-09-20 19:13:42 +09:00
parent ea43df2f61
commit 66a6bbc6f5

View File

@ -559,6 +559,20 @@ namespace WebSocketSharp.Net
}
}
private static void urlPathEncode (char c, StringBuilder output)
{
if (c > 32 && c < 127) {
output.Append (c);
return;
}
var bytes = Encoding.UTF8.GetBytes (new[] { c });
foreach (var b in bytes) {
var i = (int) b;
output.AppendFormat ("%{0}{1}", _hexChars[i >> 4], _hexChars[i & 0x0F]);
}
}
private static void writeCharBytes (char c, IList buffer, Encoding encoding)
{
if (c > 255) {