From 76a2796d85ef67f35c6efdf665a9fc9aa1750c2b Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 5 Nov 2018 20:10:08 +0900 Subject: [PATCH] [Modify] Replace it --- websocket-sharp/Net/HttpUtility.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 02cbcd25..7bef5365 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -1154,7 +1154,14 @@ namespace WebSocketSharp.Net public static byte[] UrlDecodeToBytes (string s) { - return UrlDecodeToBytes (s, Encoding.UTF8); + if (s == null) + throw new ArgumentNullException ("s"); + + if (s.Length == 0) + return new byte[0]; + + var bytes = Encoding.ASCII.GetBytes (s); + return urlDecodeToBytes (bytes, 0, bytes.Length); } public static byte[] UrlDecodeToBytes (string s, Encoding encoding)