0

I am making an application where I fetch tweets and store them in a database for future editing and what I found is that my local database (run with XAMPP) stores non-latin characters as question marks.

For example:

This is the tweeter status I see in the debugger of my IDE (NetBeans):

1

This is the status in tweeter:

2

This is the status in my database:

3

My source code is saved as UTF-8, fullText and editedText fields are both varchar(255) utf8_general_mysql500_ci and the Server Collation is utf8mb4_general_ci.

What is going wrong here?

Aki K
  • 1,222
  • 1
  • 27
  • 49
  • 1
    http://stackoverflow.com/questions/279170/utf-8-all-the-way-through – Mihai Apr 19 '14 at 14:41
  • 1
    Thanks, looks like I had to set the char encoding in the driver as well http://stackoverflow.com/questions/730359/problems-reading-writing-utf-8-data-in-mysql-from-java-using-jdbc-connector-5-1 – Aki K Apr 19 '14 at 15:52

1 Answers1

0

SqlServer varchar only supports single-byte-character-sets such as Latin-1.

If you have control of the database, try using nvarchar which supports double-byte character-sets.

varchar overview: http://dev.mysql.com/doc/refman/5.5/en/char.html

Latin-1 Supported characters: http://en.wikipedia.org/wiki/ISO/IEC_8859-1

Bob Gilmore
  • 12,608
  • 13
  • 46
  • 53
chrisA
  • 117
  • 1
  • 3