How to handle special characters in web application
Naga Chalapathi Rao
Greenhorn
Joined: Oct 14, 2007
Posts: 3
posted
0
Hi,
I have a problem at hand. I tried to specify the encoding format in HTML page using <meta> tag, also set the character encoding of request object before accessing the parameters to "UTF-8". Tried to check encoding type using log statement, it is showing "UTF-8", but when am trying to print parameters after fetching, am seeing either garbage value or no signof special character in some cases. No clue why this is so ? can some one help me figuring it out ?
Thanks, Chalap
Michael Ku
Ranch Hand
Joined: Apr 20, 2002
Posts: 510
posted
0
To where are you printing the parameters?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
But the web page that is generated by the servlet shows the characters correctly?
I am trying to print the input in system console. I do see correct input when i invoke javascript alert.
Naga Chalapathi Rao
Greenhorn
Joined: Oct 14, 2007
Posts: 3
posted
0
One addition to my post. The web page shows it correctly but i see wrong values in DB after storing. Perhaps i think the charset of DB is having some role to do with this.
I tried to print the input in console of IDE to verify and issue is obesrved in this situation.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
The console may not support Unicode, so that's not necessarily an indication that something is going wrong.