0

i have an application with use Hibernate and Mysql. In Mysql i have a blob in my table. When i record a value in this table with accent like é or è in mysql i have a good result (binary) so when i want read into my jsp i have ? instead of é

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
Mercer
  • 9,736
  • 30
  • 105
  • 170

2 Answers2

0

You cannot reliably use accented characters in HTML. You should actually use HTML character codes. I believe this is due to interpretation of the characters by the browser.

Have a look at this stackoverflow question which suggests a java library to handle this kind of stuff.

Community
  • 1
  • 1
extraneon
  • 23,575
  • 2
  • 47
  • 51
  • can i use this in my jdbc url ..? useUnicode=true&characterEncoding=UTF-8 – Mercer Apr 13 '10 at 07:55
  • @Mercer it might if your JSP also sends a header stating it's UTF-8 so the browser knows how to interpret it. I believe that might just be more work, and less reliable, than converting the string. – extraneon Apr 13 '10 at 08:18
0

Wrong response encoding? Do you use the following directive in your JSPs?

<%@ page contentType="text/html; charset=UTF-8" %> 
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124