Depending on what you intend to encode and for what reasons there is
HtmlEncode/HtmlDecode and UrlEncode/UrlDecode. These serve different
purposes. The first encodes data that becomes part of a web page so
that you can prevent cross site scripting attacks and/or javascript
defacement attacks. The latter encodes urls so that characters that
aren't supported by the browser are handled (and or aren't accidentally
accepted). If you are planning to go down this route because you are
attempting to prevent attacks from the outside also be sure to use some
form of parameterized query when working with the database so you don't
open yourself up to SQL Injection attacks. Hope this helps.
Have A Better One!
John M Deal, MCP
Necessity Software