Special Characters Problem After Html Decoding

When recording values into an SQL database you might wanna encode the inputs that are input by the users of your system as a security measure to prevent possible injection attacks. You can encode the input before recording into your database and decode it when it needs to be displayed back to the user.

But be careful with the number of HtmlEncodings and counter HtmlDecodings you perform. If by mistake you perform 2 (n) encodings and try to display the data back after doing 1 (n-1) decoding (as it was in my case) you could get unexpected results.

So if you are having display problems with some special characters even though you have done HtmlDecoding then you might wanna check for extra HtmlEncoding(s).

Hope this helps someone.

Good luck,

Leave a Reply

Your email address will not be published. Required fields are marked *