//\r
// System.Net.WebUtility\r
//\r
-// Author: Mike Kestner <mkestner@novell.com>\r
+// Authors: Mike Kestner <mkestner@novell.com>\r
+// Marek Safar (marek.safar@gmail.com)\r
//\r
+// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)\r
//\r
// Permission is hereby granted, free of charge, to any person obtaining\r
// a copy of this software and associated documentation files (the\r
\r
public static string HtmlDecode (string value)\r
{\r
+ if (string.IsNullOrEmpty (value))\r
+ return value;\r
+\r
return HttpUtility.HtmlDecode (value);\r
}\r
\r
public static void HtmlDecode (string value, TextWriter output)\r
{\r
+ if (output == null)\r
+ throw new ArgumentNullException ("output");\r
+\r
output.Write (HtmlDecode (value));\r
}\r
\r
\r
public static void HtmlEncode (string value, TextWriter output)\r
{\r
+ if (output == null)\r
+ throw new ArgumentNullException ("output");\r
+\r
output.Write (HtmlEncode (value));\r
}\r
+ \r
+ public static string UrlDecode (string encodedValue)\r
+ {\r
+ return HttpUtility.UrlDecode (encodedValue);\r
+ }\r
+ \r
+ public static byte[] UrlDecodeToBytes (\r
+ byte[] encodedValue, int offset, int count)\r
+ {\r
+ return HttpUtility.UrlDecodeToBytes (encodedValue, offset, count);\r
+ }\r
+ \r
+ public static string UrlEncode (string value)\r
+ {\r
+ return HttpUtility.UrlEncode (value);\r
+ }\r
+ \r
+ public static byte[] UrlEncodeToBytes (\r
+ byte[] value, int offset, int count)\r
+ {\r
+ return HttpUtility.UrlEncodeToBytes (value, offset, count);\r
+ }\r
}\r
}\r
#endif\r