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