Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

unicode issue  RSS feed

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

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"
pageEncoding="utf-8"%>

In local.properties 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"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8" />


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




<property name="hibernateProperties">
<props>
<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">org.gjt.mm.mysql.Driver</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

Thanks
Regards
Anshul Bhatt


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!