[Modify] Throw exception
This commit is contained in:
parent
0aa1a544f7
commit
503767d31e
@ -1288,10 +1288,12 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
public static string UrlEncodeUnicode (string s)
|
public static string UrlEncodeUnicode (string s)
|
||||||
{
|
{
|
||||||
if (s == null || s.Length == 0)
|
if (s == null)
|
||||||
return s;
|
throw new ArgumentNullException ("s");
|
||||||
|
|
||||||
return Encoding.ASCII.GetString (InternalUrlEncodeUnicodeToBytes (s));
|
return s.Length > 0
|
||||||
|
? Encoding.ASCII.GetString (InternalUrlEncodeUnicodeToBytes (s))
|
||||||
|
: s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] UrlEncodeUnicodeToBytes (string s)
|
public static byte[] UrlEncodeUnicodeToBytes (string s)
|
||||||
|
Loading…
Reference in New Issue
Block a user