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

Internationalization - JSP and MySQL

Gary Sheldon
Ranch Hand

Joined: Nov 21, 2011
Posts: 44
I am going round and round in circles, having serious issues relating to international characters being stored in and viewed from the database.

I have my database set as UTF-8, page encoding as <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> and the connection to the database as useUnicode=true&characterEncoding=utf-8

Still and for the reason which escapes me is that any special charcaters are initially not stored correctly, for example 'çanak çömlek patladı' would be stored as 'çanak çömlek patlad?' if I then read back from the database 'çanak çömlek patlad?' and then re save without modifying the data, the text 'çanak çömlek patlad?' now looks like '￧anak ￧�mlek patlad?'

If again I dont update any content and re save the page the result is then '?anak ??mlek patlad?' its at this point where no matter how many times I save the record i keep '?anak ??mlek patlad?' but its still not the original text entered which was 'çanak çömlek patladı'

One other issue is that this database has been migrated several times to which I have inherited, the are issues replating to old non ascii characters, is there any way to run a MySQL script to address each non ascii character and set as UTF-8?

Can someone please help??
I agree. Here's the link:
subject: Internationalization - JSP and MySQL
It's not a secret anymore!