From 0e840a5df7c96a01ca44b85b038014e425b6a775 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 3 Jan 2018 16:42:38 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/Net/HttpUtility.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 55728fe6..03223ade 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -751,6 +751,22 @@ namespace WebSocketSharp.Net } } + internal static bool TryGetEncoding ( + string contentType, out Encoding result + ) + { + result = null; + + try { + result = GetEncoding (contentType); + } + catch { + return false; + } + + return true; + } + #endregion #region Public Methods