I am using JPA to insert into Mysql database and it is not able to persist symbols like double quotes(") or euro etc. instead of that it persist Que mark (?)
+1
A:
Looks like some "Unicode problem".
Double check that you are using UTF-8 as character encoding for your tables/database (or maybe even as default CHARACTER SET). See 9.1.3. Specifying Character Sets and Collations.
Pascal Thivent
2010-09-29 04:39:28
It's the table encoding. A wrong charset in connection string or HTTP request would only have produced [mojibake](http://en.wikipedia.org/wiki/Mojibake), not questionmarks. See also [this article](http://balusc.blogspot.com/2009/05/unicode-how-to-get-characters-right.html).
BalusC
2010-09-29 11:37:40
@BalusC Wow, your article is simply... awesome.
Pascal Thivent
2010-09-29 14:27:48
@BalusC Answer fixed, thanks.
Pascal Thivent
2010-10-07 11:28:38
A:
Thanks for ur reply It is not Unicode related problem i checked my character set form db to app server It is UTF-8
if i type the symbol it get inserted into db correctly but if i copied form somewhere else it insert mojibake.
romani
2010-10-07 11:03:39
How did you confirm that it persisted question marks in first place? You checked it using some DB admin tool, right? Because for example querying the data and writing it to stdout which doesn't support the encoding would have produced question marks as well. Mojibake will only occur when the data is decoded/encoded using the wrong encoding before/after being transferred as bytes from A to B.
BalusC
2010-10-07 12:22:54