Skip to content

Commit 0e840a5

Browse files
committed
[Modify] Add it
1 parent 71385d5 commit 0e840a5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

websocket-sharp/Net/HttpUtility.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,22 @@ internal static byte[] InternalUrlEncodeUnicodeToBytes (string s)
751751
}
752752
}
753753

754+
internal static bool TryGetEncoding (
755+
string contentType, out Encoding result
756+
)
757+
{
758+
result = null;
759+
760+
try {
761+
result = GetEncoding (contentType);
762+
}
763+
catch {
764+
return false;
765+
}
766+
767+
return true;
768+
}
769+
754770
#endregion
755771

756772
#region Public Methods

0 commit comments

Comments
 (0)