Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unicode Characters

 
M. White
Greenhorn
Posts: 18
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everytime I fetch data (mostly strings ) from mysql database, several characters were replaced by "??". Is there a way I can preserve the original value? Thanks for the help.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which characters are those, and how do you know they went bad - are you printing them to a console? If so, be aware that many console can't handle anything but ASCII.
 
M. White
Greenhorn
Posts: 18
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Characters like ’ and é. I displayed it in eclipse console. By the way, I changed the Encoding to UTF-8 in Preferences-General-Editor. Also in debug mode, when i view the values in the Variables tab, the characters were also replaced by ??. Thanks for the response.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know whether the Eclipse console (or Variables tab) can handle Unicode; you might want to verify that by in other way.
And just to ask the obvious: the DB encoding is set to something that can handle those characters, and they are still OK in the DB?
 
M. White
Greenhorn
Posts: 18
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. The values are still preserved in the db.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic