Auto-Detect File Encoding Message

muzza4's profile image muzza4 posted 3 years ago in General Permalink

Hi Ansgar

After updating to 11.1.0.6012 I now get a message when opening a saved SQL query...

**Really auto-detect file encoding?

Auto detecting the encoding of a file is highly discouraged. You may experience data loss if the detection fails.

[Yes] [Cancel]**

We've changed nothing on our server - can you advise what this means and why it's now showing (and how can I remove the message).

Regards Muzza

ansgar's profile image ansgar posted 3 years ago Permalink

I thought the message is self explanatory, but it's obviously not. You need to select the right encoding in the file-open-dialog:

Description

Could you give it a try and rephrase that error message here to be more intuitive?

muzza4's profile image muzza4 posted 3 years ago Permalink

Hi Ansgar

Oops, I'm a bit embarrassed. I guess I just select a file and press Enter without reading anything!

Perhaps...

Really auto-detect file encoding?

Auto detecting the encoding of a file is highly discouraged. You may experience data loss if the detection fails.

To avoid this message select the correct encoding before pressing Open.

Regards Muzza

Code modification/commit 9fcfda8 from Ansgar Becker <anse@heidisql.com>, 3 years ago, revision 11.1.0.6212
Follow up to e66121a1c3cfe00c3ddbaca27ac11a052f4f4f6a: extend warning message to point the user in the right direction. See https://www.heidisql.com/forum.php?t=37505#p37514
ansgar's profile image ansgar posted 3 years ago Permalink

Message now uses your third paragraph in the next build - thanks for that.

No worries about not having read the message - that's a problem for the majority of users I suppose. I can see it when people get some simple message dialog and ask me for what they have to do now, even when the message already says it. Even worse: to get rid of such dialogs, they click the upper right "x" button of the dialog to close it, not knowing which decision that makes.

Well, that means error messages in general have to be as simple as they can, for every user. If the context is not simple enough, the message should probably contain something like "If you don't understand this, please ask a technician".

TJO's profile image TJO posted 3 years ago Permalink

Hi Ansgar.

Certainly it was a good idea to include an encoding selector in the open dialog. However, I wonder why there is no such selector in the save dialog. I could not even find a setting for the standard encoding in the preference menus. Am I missing something?

How do I know which encoding Heidi uses when saving my .sql files?

Thanks for your help.

Best regards, Tim

ansgar's profile image ansgar posted 3 years ago Permalink

That's true, the save-file dialogs don't have that encoding drop-down. HeidiSQL uses UTF-8 in all cases here, with one exception: when exporting a grid result, the export dialog offers an encoding selector.

I see no real use for saving files in different encodings than UTF-8.

lieszkol's profile image lieszkol posted 3 years ago Permalink

Hi Ansgar,

I appreciate the reasoning behind showing such a warning, however, I have never had an issue with data loss when opening a file. I'm not saying it's not possible, but it isn't an issue for me personally. And even if I were to mess up a file by opening it with the wrong encoding and resaving it, this wouldn't be an issue for me since I use version control. I assume most devs do.

However, now I have to click "Yes" every time I open a file in HeidiSQL (or I have to click on a drop-down and select "UTF-8", which is even more clicks. I use HeidiSQL extensively (which is why I have donated several times), so clicking this box over and over again every day is...quite frustrating.

I would much prefer having a "Do not show this message again (at my own risk)" option on the dialog box or perhaps some setting in the application options, perhaps a "Default File Open Encoding", which if I set to "UTF-8" then Heidi just opens each file as UTF-8 without showing a warning.

Thanks again for this great program!

Regards from Budapest, Laszlo

ansgar's profile image ansgar posted 3 years ago Permalink

@lieszkol: the encoding is remembered by HeidiSQL. So the encoding drop-down should show up the last used encoding. Isn't that the case for you? It definitely should, otherwise that's a bug!

lieszkol's profile image lieszkol posted 3 years ago Permalink

Oh, my bad! Didn't notice that. I actually use an AutoHotkey script to open my sql files from visual studio in heidi with a simple key combination, and it didn't occur to me to first try and manually open a file as you write.

Nevermind my post then. Thanks @ansgar!

phamduchuy552's profile image phamduchuy552 posted 2 years ago Permalink

I thought the message is self explanatory, but it's obviously not. You need to select the right encoding in the file-open-dialog:

Description

Could you give it a try and rephrase that error message here to be more intuitive?

Thank you. I was looking for this

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