I have defaulted the entry box with some example content and then encoded it and then decoded the result to prove the decoding works. Notice I have used standard characters < > & " as well as UTF-8 text (I have no idea what the Arabic says) and some already encoded entities to prove that anything already encoded will not get double encoded. Obviously if you don't mind about double encoding then call Encoder.htmlEncode(value,true) with a second parameter set to true or if you are using my form for your own encoding make sure the checkbox is ticked.
25 April 2011
HTML Encoder and Decoder
I have defaulted the entry box with some example content and then encoded it and then decoded the result to prove the decoding works. Notice I have used standard characters < > & " as well as UTF-8 text (I have no idea what the Arabic says) and some already encoded entities to prove that anything already encoded will not get double encoded. Obviously if you don't mind about double encoding then call Encoder.htmlEncode(value,true) with a second parameter set to true or if you are using my form for your own encoding make sure the checkbox is ticked.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment