0

I'm trying to insert a chinese character into the DB, but while redirecting from one jsp to another jsp the value changes from 油墨 to 油墨 and the changed value is inserted to DB. For this I used the below tag.

 <%@ page language="java"  contentType="text/html; charset=UTF-8"
 pageEncoding="UTF-8" %>
Cœur
  • 37,241
  • 25
  • 195
  • 267
Bam
  • 79
  • 1
  • 2
  • 11

1 Answers1

0

Check if you support UTF-8 in your database's text fields, if so, you need to use UTF-8 encoding in all you app.

If you're using Tomcat server, you can follow the UTF-8 everywhere HOWTO from Tomcat FAQ.

If you use JBoss try this:

<system-properties>
    <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
    <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
</system-properties>

Check also this post if you still having troubles...

Jordi Castilla
  • 26,609
  • 8
  • 70
  • 109
  • Before inserting the data into the DB , the value is changed(different font and format). If i insert manually it takes as I give. so there is no problem in DB side. while redirecting the JSP only it happens..Thats where I'm facing problem. – Bam Apr 20 '15 at 09:03
  • Which server are you using?? – Jordi Castilla Apr 20 '15 at 09:20