In a form, I have a text field, First Name. I enter a value ��������. I submit the form. Upon the submit, the special characters in the first name is encoded to some weird value in the request parameter. This weird value is inserted in the database column. These encoded characters occupy more characters per normal character. So while inserting into the database,it exceeds the database column limit and it throws an exception.
How do I prevent this encoding of special characters in the Request parameter?
hi Ray Cutler Um....If I do the encoding, first of all, I check the ASCII value for each character as the ASCII value may be out of the range. I am not sure that I answer your question but my idea is check the ASCII value for each value first and using (MOD) function to avoid some problem and then decide which Linear equation to encode the string. May be you can check which range of character using much byte to store, as I do not know the size of storing each character. Just my suggestion and my simple idea
Let me guess: You are talking about http client (like mozilla) on one side and a servlet on the other side? Correct?
Firstly you must realize that it is not the servlet who encodes anything. It is the web browser. You cannot prevent it. I would suggest that you find out what kind of encoding it is (standard), what the character encoding in the browser is (one of the headers). Then you can do it.
Look up HTTP RFC and have a nice evening ;-)
Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>
subject: Encoding of special characters in the request parameter