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

File is corrupted while saving differences in changed file (Ctrl+S) #607

Closed
Darkums opened this issue Feb 5, 2021 · 9 comments
Closed

Comments

@Darkums
Copy link

Darkums commented Feb 5, 2021

In .sql file saved WinMerge replaces:

  • % with +ACU-
  • " with +ACI-
  • ; with +ADs-
  • _ with +AF8-
  • = with +AD0-

If corrupted file is opened to check for differences those differences are not showed.

@Darkazas
Copy link

Darkazas commented Feb 5, 2021

File is corrupted the same on 2.16.9-x64 and 2.16.10-x64 versions.

@sdottaka
Copy link
Member

sdottaka commented Feb 5, 2021

Could you show me a file that can reproduce the bug?

@Darkums
Copy link
Author

Darkums commented Feb 5, 2021

BarcodeParser_H.sql.txt

@Darkums
Copy link
Author

Darkums commented Feb 5, 2021

Remove .txt and you got the original.

@Darkums
Copy link
Author

Darkums commented Feb 5, 2021

sdottaka added a commit that referenced this issue Feb 5, 2021
@sdottaka
Copy link
Member

sdottaka commented Feb 5, 2021

Thank you for attaching the file.

WinMerge uses mlang.dll by default to attempt automatic detection of file encoding.

mlang.dll seems to think that the file encoding of the file is UTF-7 (codepage = 65000).

image

Saving the file as UTF-7 will replace the characters as you reported.

For this reason, the behavior has been fixed at commit d869af4 to replace it with the default encoding if it determines UTF-7.

As a workaround, uncheck the checkboxes listed below in the Codepage category of the Options dialog.

image

A file saved in UTF-7 should be able to be recovered by opening the file with WinMerge and saving it in a different encoding as shown below in the File-> File Encoding menu.

image

Thank you for your report.

@Darkazas
Copy link

Darkazas commented Feb 5, 2021

I'm turning this option on\off from time to time (because it works life alpha product). Just didn't check the status bar this time.

@Darkazas
Copy link

Darkazas commented Feb 5, 2021

Maybe optional confirmation yes\no message box with detected code page would be appropriate ?

@sdottaka
Copy link
Member

Most people don't expect the files to be opened in UTF-7. I don't like the message box that appears when I open the files. You can reopen the file in UTF-7 by specifying code page 65000 (UTF-7) from the File-> File Encoding menu item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants