1

Situation

I have a lot of UTF-8 characters saved in a MySQL database.

In PHP, I do this:

SELECT name FROM institutions;

The characters display correctly with no problems and no additional processing necessary within the query or within the PHP script.

In Aqua Data Studio 16.0.9 I'm having a bit of a problem displaying UTF-8 characters. Instead of Å it displays as Ã…, instead of é it displays as é and so on.

What I've tried so far are in terms of the query itself:

  1. SELECT CONVERT(name USING utf8) FROM institutions;
  2. SET NAMES 'utf8'; SELECT name FROM institutions;
  3. A combination of the solutions above.
  4. Changed the font of Aqua Data Studio to a font that supports UTF-8 like Verdana, Arial, etc.

So far none of what I did worked.

Questions

  • How do I support UTF-8 in Aqua Data Studio 16.0.9?
  • Can I instead of doing the fix in the query itself, just configure Aqua Data Studio so that any other queries in the future are UTF-8 compatible?

Edit

I also tried adding ?characterEncoding=UTF-8 to the Driver Parameters under the Server Properties window and still I can't get it to display the characters correctly.

dokgu
  • 4,957
  • 3
  • 39
  • 77

2 Answers2

2

Mojibake. Usually...

  • The bytes you have in the client are correctly encoded in utf8 (good).
  • You connected with SET NAMES latin1 (or set_charset('latin1') or ...), probably by default. (It should have been utf8.)
  • The column in the tables may or may not have been CHARACTER SET utf8, but it should have been that.
Rick James
  • 135,179
  • 13
  • 127
  • 222
  • The [answer here](http://stackoverflow.com/questions/1049728/how-do-i-see-what-character-set-a-mysql-database-table-column-is/1049958#1049958) tells me how to check the character set at the `schema`, `table`, and `column` levels. When I ran those, the `schema` is set to `latin1`, the `table` is set to `utf8` and the `column` is set to `utf8` as well. – dokgu Apr 27 '16 at 18:45
  • I also tried adding `?characterEncoding=UTF-8` to the `Driver Parameters` under the `Server Properties` window and still I can't get it to display the characters correctly. – dokgu Apr 27 '16 at 19:00
  • In ADS it should be ?characterEncoding=utf8 – tariq Apr 27 '16 at 21:09
  • @tariq I tried `?characterEncoding=utf8` as well and it still doesn't display properly. – dokgu Apr 28 '16 at 13:52
  • @tariq Maybe the characters aren't `UTF-8`? – dokgu Apr 28 '16 at 21:23
  • @RickJames I have that set to true by default. I even tried doing `?characterEncoding=utf8&useUnicode=true` under the driver parameters and it still wouldn't display properly. – dokgu Apr 29 '16 at 14:19
  • Can you check your query results in the MySQL command line tool ? Is the results different from Aqua Data Studio ? – tariq Apr 29 '16 at 17:16
0

enter image description here

Make sure to have these 3 lines in your my.conf :

collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

In ADS v16 Server Properties, you can override the default connection to force utf8 by setting:
?characterEncoding=utf8

tariq
  • 615
  • 5
  • 12