File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Encoding headache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Encoding headache" Watch "Encoding headache" New topic

Encoding headache

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3479

We are using Spring and Hibernate in our RIA.
Our MySQL 5 database is configured to handle UTF-8
A snippet from applicationContext.xml
<property name="hibernateProperties">
<prop key="hibernate.connection.charSet">UTF-8</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
But when sending Arabic characters to the servlet and trying to save them to the database,they got saved as strange symbols.
On the servlet, I tried every thing: URLDecoder, URLEncoder, setCharacterEncoding
Any ideas?
Spring 2.5
Hibernate 3.2
Ubuntu 7.10
I agree. Here's the link:
subject: Encoding headache
It's not a secret anymore!