[Modify] Polish it
This commit is contained in:
parent
c164b810ff
commit
80dffde6dd
@ -951,11 +951,10 @@ namespace WebSocketSharp.Net
|
|||||||
if (s.Length == 0)
|
if (s.Length == 0)
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
if (encoding == null)
|
|
||||||
encoding = Encoding.UTF8;
|
|
||||||
|
|
||||||
var bytes = Encoding.ASCII.GetBytes (s);
|
var bytes = Encoding.ASCII.GetBytes (s);
|
||||||
return encoding.GetString (urlDecodeToBytes (bytes, 0, bytes.Length));
|
return (encoding ?? Encoding.UTF8).GetString (
|
||||||
|
urlDecodeToBytes (bytes, 0, bytes.Length)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string UrlDecode (byte[] bytes, Encoding encoding)
|
public static string UrlDecode (byte[] bytes, Encoding encoding)
|
||||||
|
Loading…
Reference in New Issue
Block a user