public sealed class HttpServerUtility {
public string HtmlEncode(string s) {
return HttpUtility.HtmlEncode(s);
}
public void HtmlEncode(string s, TextWriter output) {
HttpUtility.HtmlEncode(s, output);
}
public string HtmlDecode(string s) {
return HttpUtility.HtmlDecode(s);
}
public void HtmlDecode(string s, TextWriter output) {
HttpUtility.HtmlDecode(s, output);
}
public string UrlEncode(string s) {
Encoding e = (_context != null) ? _context.Response.ContentEncoding : Encoding.UTF8;
return HttpUtility.UrlEncode(s, e);
}
public void UrlEncode(string s, TextWriter output) {
if (s != null)
output.Write(UrlEncode(s));
}
public string UrlDecode(string s) {
Encoding e = (_context != null) ? _context.Request.ContentEncoding : Encoding.UTF8;
return HttpUtility.UrlDecode(s, e);
}
public void UrlDecode(string s, TextWriter output) {
if (s != null)
output.Write(UrlDecode(s));
}
}