Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Handling Chinese Characters for UTF-8 DB  RSS feed

Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have Oracle with UTF-8 Encoding as BackEnd for my applicaition.
I have a jsp page set with utf-8 encoding using <%@page contentType="text/html; charset=UTF-8"%>.
This page has a Form where in the user will type in text of any language.
Currently I have to test applicaition with Chinese Chars.
How do I get the input using request.getParameter() from the user in correct format so that I can store the text in DB with out any loss of Data.
I was tryinging to use this option.
String orig = request.getParameter("name");
String real = new String(orig.getBytes("ISO8859_1"),"UTF8");But it isnt working. The Chinese chars are not being stored in DB.
Do I still have to use the second line even though I have charset of my page set to UTF-8.
Any help in this regard is greatly appriciated.
Rajesh A.S
[ September 27, 2005: Message edited by: Rajesh Savitri ]
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!