Connections charset encoding

PavelVD's profile image PavelVD posted 2 weeks ago in General Permalink

When i check charset in command line client i see my charset utf8_mb3 agree with server charset character_set_client utf8mb3 character_set_server utf8mb3

When i check character set in heidi after connection i see

character_set_client utf8mb4 character_set_server utf8mb3

Why ? And how can i fix it ?

ansgar's profile image ansgar posted 2 weeks ago Permalink

I highly suppose utf8mb3 fits into to the newer utf8mb4 charset, so I assume there is no real issue with that, or?

HeidiSQL tries to be most Unicode compatible, for instance when you load text files and such things.

If you still want to override that, you can create a startup SQL script, containing SET NAMES utf8mb3; and put it into your session settings:

grafik.png

PavelVD's profile image PavelVD posted 2 weeks ago Permalink
  1. Why heidi ignore server charset settings ?
  2. I add sql script with set names utf8mb3 - heidi ignore it and show utf8mb4
ansgar's profile image ansgar posted 2 weeks ago Permalink

Definitely works here, using the current v12.15 or the v13 preview:

grafik.png

Regarding the character_set_server variable - that one often contains a bad value. Probably not in your case but on many other servers this is latin1 or a similar old charset.

PavelVD's profile image PavelVD posted 2 weeks ago Permalink

It's not clear to me why the DB client transparently, without parameters or user notification, changes the server's default behavior. Why not simply add the encoding parameter to the connection settings in this case?

ansgar's profile image ansgar posted 2 weeks ago Permalink

I think I made clear why this is the case.

You could really come to the point and say if that causes a real issue.

PavelVD's profile image PavelVD posted 2 weeks ago Permalink

It's a bit odd that a simple database client ignores some database server settings, overriding them at its own discretion. Is this correct?

ansgar's profile image ansgar posted 2 weeks ago Permalink

I don't think it's odd. I think you over-value the default server charset. In my experience this was never the "best" one which the client should use.

As said HeidiSQL tries to be most Unicode compatible out-of-the-box. Many (MySQL) servers in the wild have a bad default server charset, although they are Unicode compatible for a long time. If there was a user setting for the encoding, the responsibility to select a good encoding would move from the app to the user. Many users would still blame the app when encoding errors happen.

It also was a UX aspect to leave that setting away from the session settings.

PavelVD's profile image PavelVD posted 2 weeks ago Permalink

Thank you very much for the clarification. We'll keep this in mind and inform users that when using the heidi, they shouldn't rely on the parameters they see in the standard command-line client.

ansgar's profile image ansgar posted 2 weeks ago Permalink

Thank you for understanding!

Please login to leave a reply, or register at first.