Is this question about encoding URL GET parameters, i.e. changing spaces to +, or about encoding data to be displayed on an HTML page that may have <,>, and & in it?
You’ve given the answer for the first, but not the case of of HTML escape encoding. You’d want to do this if you’re writing a guestbook (or FAQ entry system) and you don’t want the submitter to be able to submit HTML. I ended up writing a small loop using StringBuffer.replace() to replace ‘<' with '<', etc.
Related Questions
- Is this question about encoding URL GET parameters, i.e. changing spaces to +, or about encoding data to be displayed on an HTML page that may have <,>, and & in it?
- What is the difference between URL encoding, URL rewriting, HTML escaping, and entity encoding?
- Does webserver 6.1 support toggling of strictly enforced url encoding?