Bug 15574. XML deserialization recursion: add array type to known_types?
[mono.git] / mcs / class / System / System.Net / WebUtility.cs
1 //\r
2 // System.Net.WebUtility\r
3 //\r
4 // Author: Mike Kestner  <mkestner@novell.com>\r
5 //\r
6 //\r
7 // Permission is hereby granted, free of charge, to any person obtaining\r
8 // a copy of this software and associated documentation files (the\r
9 // "Software"), to deal in the Software without restriction, including\r
10 // without limitation the rights to use, copy, modify, merge, publish,\r
11 // distribute, sublicense, and/or sell copies of the Software, and to\r
12 // permit persons to whom the Software is furnished to do so, subject to\r
13 // the following conditions:\r
14 // \r
15 // The above copyright notice and this permission notice shall be\r
16 // included in all copies or substantial portions of the Software.\r
17 // \r
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
19 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
20 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
23 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
25 //\r
26 \r
27 #if NET_4_0\r
28 using System;\r
29 using System.IO;\r
30 using System.Runtime.Serialization;\r
31 \r
32 namespace System.Net \r
33 {\r
34 \r
35         public static class WebUtility \r
36         {\r
37                 \r
38                 public static string HtmlDecode (string value)\r
39                 {\r
40                         return HttpUtility.HtmlDecode (value);\r
41                 }\r
42                 \r
43                 public static void HtmlDecode (string value, TextWriter output)\r
44                 {\r
45                         output.Write (HtmlDecode (value));\r
46                 }\r
47                 \r
48                 public static string HtmlEncode (string value)\r
49                 {\r
50                         return HttpUtility.HtmlEncode (value);\r
51                 }\r
52                 \r
53                 public static void HtmlEncode (string value, TextWriter output)\r
54                 {\r
55                         output.Write (HtmlEncode (value));\r
56                 }\r
57                 \r
58                 public static string UrlDecode (string encodedValue)\r
59                 {\r
60                         return HttpUtility.UrlDecode (encodedValue);\r
61                 }\r
62                 \r
63                 public static byte[] UrlDecodeToBytes (\r
64                         byte[] encodedValue, int offset, int count)\r
65                 {\r
66                         return HttpUtility.UrlDecodeToBytes (encodedValue, offset, count);\r
67                 }\r
68                 \r
69                 public static string UrlEncode (string value)\r
70                 {\r
71                         return HttpUtility.UrlEncode (value);\r
72                 }\r
73                 \r
74                 public static byte[] UrlEncodeToBytes (\r
75                         byte[] value, int offset, int count)\r
76                 {\r
77                         return HttpUtility.UrlEncodeToBytes (value, offset, count);\r
78                 }\r
79         }\r
80 }\r
81 #endif\r