mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Warn the user about potential data loss when loading a (csv) file with encoding set to "auto-detect". There are still EEncodingError reports uploaded.
This commit is contained in:
@ -673,6 +673,10 @@ begin
|
||||
editfilename.Text := Dialog.FileName;
|
||||
FFileEncoding := Mainform.GetEncodingByName(Dialog.Encodings[Dialog.EncodingIndex]);
|
||||
if FFileEncoding = nil then begin
|
||||
MessageDialog(_('Auto detecting the encoding of a file is highly discouraged. You may experience data loss if the detection fails.') +
|
||||
SLineBreak + SLineBreak +
|
||||
_('To avoid this message select the correct encoding before pressing Open.'),
|
||||
mtWarning, [mbOK]);
|
||||
TestStream := TFileStream.Create(Dialog.Filename, fmOpenRead or fmShareDenyNone);
|
||||
FFileEncoding := DetectEncoding(TestStream);
|
||||
TestStream.Free;
|
||||
|
Reference in New Issue
Block a user