Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unicode issue

anshul bhatt
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I want to display different languages in my website. Am able to save the language font in the mysql 5.0, however while retrieving it, it displays junk characters. My project is using spring+hibernate+struts 2. I tried to modify the files as

In Jsp:<%@ page language="java" contentType="text/html; charset=UTF-8"

In file : database.url=jdbc:mysql://localhost/PHONYLITE?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
This database.url is being used in applicationContext-services.xml, applicationContext.xml.

Am using tomcat so changed server.xml as : <Connector port="8080" protocol="HTTP/1.1"
redirectPort="8443" URIEncoding="UTF-8" />

Have also put in this in in applicationContext-services.xml

<property name="hibernateProperties">
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop>
<prop key="hibernate.show_sql">${hibernate.showSql}</prop>
<prop key="hibernate.connection.driver_class"></prop>
<prop key="hibernate.connection.url">${database.url}</prop>
<!-- jdbc:mysql://localhost/mydb?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8, -->
<prop key="hibernate.connection.username">root</prop>
<prop key="hibernate.connection.password">root</prop>

<prop key="hibernate.connection.useUnicode">true</prop>
<prop key="hibernate.connection.characterEncoding">UTF-8</prop>
<prop key="hibernate.connection.charSet">UTF-8</prop>

Still am not able to display the characters, any help would be really appreciated

Anshul Bhatt

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic