Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIN1250 encoding is handled improperly #22

Closed
halmai opened this Issue Nov 30, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@halmai
Copy link

halmai commented Nov 30, 2017

I filed a bug report several months ago into the old bug tracking system. In order to keep it alive, I create one for the issue here as well.

Expected behavior

Data from a PostgreSQL database with WIN1250 encoding should be displayed incorrectly.

Current behavior

Accented characters are displayed as wrong characters.

Steps to reproduce

  1. I create a new database with encoding win1250:
createdb --encoding=WIN1250 --lc-collate=C --lc-ctype=C --template=template0 heidisql_1250
  1. I create some data in it, for example an accented a (á) which is a valid character in win1250:
create table t (c text);
insert into t values (chr(193));
  1. Check the content of the table in HeidiSql

In the place where I expect the Hungarian character á to be displayed, I get a questionmark in a diamond.

Context

This happened with the newest version of HeidiSql running on Win7 and PostgreSQL 9.0

Screenshot and previous bug report is available here: https://www.heidisql.com/forum.php?t=23972

@halmai

This comment has been minimized.

Copy link
Author

halmai commented Jan 9, 2018

Is there any plan to fix this bug in the near future? It is really hard to use HeidiSql with this defect. Or is there any chance for me to help in it?

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

ansgarbecker commented Jan 9, 2018

Probably you have some hint on how to fix that wrong encoding?

For example in MySQL mode, HeidiSQL calls the API method mysql_set_character_set(handle, 'utf8') after successful connecting. Perhaps there is some similar stuff to to in PG mode?

@halmai

This comment has been minimized.

Copy link
Author

halmai commented Jan 15, 2018

Hi Ansgar, I never used postgresql nor mysql from C or Delphi but I think the section 22.3.3. on https://www.postgresql.org/docs/9.2/static/multibyte.html could help. There are some ways mentioned right below Table 22-2 how the client encoding can be changed. I don't know if you can use any but I would start with the

SET CLIENT_ENCODING TO 'value';

I hope it helps. :)

@halmai

This comment has been minimized.

Copy link
Author

halmai commented Feb 26, 2018

Hi Ansgar, is there any progress in this topic?

This issue (and #58 and #62) make HeidiSQL very hard to use with postgresql. This current one probably casues problems not just in win1250 encoding but all other non-utf8 encodings as well. The other two issues are encoding-independent so they also should be annoying for many users.

@anrras

This comment has been minimized.

Copy link

anrras commented Apr 9, 2018

please fix this bug, is really useful for me to export selected rows in SQL INSERTS but is very annoying to edit every row with accented words

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

ansgarbecker commented Apr 9, 2018

If I read the Client/Server Character Set Conversions right, then the client encoding UTF8 should be fine when reading/writing to the server, or am I wrong?

My PG connection btw shows UTF8 when firing SHOW client_encoding;.

In MySQL/MariaDB the communication can be done mostly in UTF8 while the currently edited table data is in a totally different charset. I guess PG is not very different, at least from what I read in the docs. But I may be wrong here.

Also, in MySQL/MariaDB, there have been many users claiming HeidiSQL to do "something wrong" with the data as critical characters are shown broken, while they are ok in the user's application. In most of these cases the application was broken, storing broken data and reading it in the same broken way, so it looks ok again. Could it be that this is the case here? Sorry, I'm just guessing around, as I have no clue what's exactly broken here.

@halmai

This comment has been minimized.

Copy link
Author

halmai commented Apr 22, 2018

Hi @ansgarbecker , sorry for replying so slowly, I was on holiday. :)

You are right, if I issue the SET CLIENT_ENCODING TO 'UTF8'; command from the Query panel then both the content view and the modification commands work as expected.

This is a good work-around, however, it would be nice to set the client encoding for the given database permanently or setting it automatically because now I have to re-enter this command every time I reconnect to the database. Do you think there is a chance for this?

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

ansgarbecker commented Feb 20, 2019

Sorry for the delay, I'm overseeing things from time to time in the myriad of issues here.

Would it help if Heidi would fire SET CLIENT_ENCODING TO 'UTF8' when initializing a PG connection? I am unsure whether you want that "UTF8" to be customizable.

@ansgarbecker ansgarbecker added this to the v10.2 milestone Feb 20, 2019

ansgarbecker added a commit that referenced this issue Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.