From 148b4ba8879f96cb1a42480b4a40fb16a6016b6d Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 23 Oct 2018 20:14:53 +0900 Subject: [PATCH] [Modify] Replace it --- websocket-sharp/Net/HttpUtility.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 5b5790f1..1fb89730 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -1197,10 +1197,11 @@ namespace WebSocketSharp.Net if (count < 0 || count > len - offset) throw new ArgumentOutOfRangeException ("count"); + if (encoding == null) + encoding = Encoding.UTF8; + return count > 0 - ? InternalUrlDecode ( - bytes, offset, count, encoding ?? Encoding.UTF8 - ) + ? encoding.GetString (urlDecodeToBytes (bytes, offset, count)) : String.Empty; }