• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems retrieving utf8 encoded fields from mysql database  RSS feed

 
Mark O' Sullivan
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I currently have some fields in tables in the mysql database defined with the "collation utf8 default" for internationalisation. I currently retrieve my data from the database using prepared statements ie resultsets ,for example
rs being ResultSet but when I retrieve the utf8 fields, they return ??? instead of the utf-8 field I require. Any idea where is the best place to set this encoding, is it within the resultset itself when I'm retrieving and how do I go about this? The fields in the database tables are set correctly. Thanks in advance.
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you know they return question marks?
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're printing these values to System.out, you must know that the Windows Command Prompt and quite a lot of Unix shells have problems with characters that aren't basic / extended Latin (in other words, with a char value of <= 255).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!