file encoding is not saved when saving

blip's profile image blip posted 10 months ago in General Permalink

Good day. A sql file in ansi encoding opens and edits normally, but when you save it, it is always saved in utf 8. Is it possible to leave the encoding unchanged when saving a file, or add an encoding selection option to the save dialog?

ansgar's profile image ansgar posted 10 months ago Permalink

You just need to load the file in the specific encoding:

grafik.png

After loading, when you save the file (not "Save as"), the selected encoding should be kept.

Also, make sure you're using the latest version.

blip's profile image blip posted 10 months ago Permalink

After loading, when you save the file (not "Save as"), the selected encoding should be kept.

The encoding should be kept, but it is not. Try it yourself. I have the latest version.

blip's profile image blip posted 10 months ago Permalink

Another addition ((maybe it plays a role, maybe it doesn't)) - while working with a file and saving it, I am connected to PostgreSQL

ansgar's profile image ansgar posted 10 months ago Permalink

It makes no difference to which server you are connected.

I already did what you did - probably with some significant difference, not sure. Here's what I did:

  • create an ANSI .sql file with Notepad++, with german umlauts in it: äöüÄÖÜß
  • loaded that file in HeidiSQL and selected ANSI in the encoding drop-down (like in above screenshot)
  • modified the content in HeidiSQL, with some more umlauts
  • reloaded in Notepad++ and saw it still says ANSI encoding

Please note you must select ANSI encoding if it shouls be kept. Anything else including the auto-detect will result in UTF-8 in most cases. Also make sure your file has critical characters like german umlauts or whatever. Only if it contains such characters you can reliably differentiate between ANSI and UTF-8.

blip's profile image blip posted 10 months ago Permalink
  1. I have a file - opaopa_before.sql in ANSI encoding (see picture 1-file_before_open).
  2. I open it in HeidiSQL in ANSI encoding (see picture 2-open_in_ansi_option and 3-before_updating).
  3. I edit it in HeidiSQL (see picture 4-after_updating).
  4. I save it in HeidiSQL and it is automatically saved in UTF 8 encoding (see picture 5-file_after_editing_and_saving and file opaopa_after.sql)
3 attachment(s):
ansgar's profile image ansgar posted 9 months ago Permalink

Selected encoding is kept for tab files, but I just see I did that after the v12.10 release, for issue #2064. Please update to the latest build and try again.

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