NotepadEx icon indicating copy to clipboard operation
NotepadEx copied to clipboard

Encoding problem when saving a file in UTF-8

Open OrthodoxWindows opened this issue 11 months ago • 2 comments

I noticed when editing a .bat command file that the @echo off command no longer works after editing with NotepadEx (with the original Notepad of Windows 10, I don't have this problem). I checked, the problem also arises in the original Notepad of Windows XP. After research, I found out that it was related to UTF8 BOM encoding : https://en.wikipedia.org/wiki/Byte_order_mark The problem of extra characters in a batch file seems known : https://superuser.com/questions/769601/weird-characters-%C2%B4-at-the-start-of-a-batch-file

When I edit the file with another text editor, select UTF8 No BOM encoding and save, the problem no longer appears (the @echo off command works again). Of course, if I select the ANSI encoding when saving, the problem does not appear, but I cannot use this encoding, because it does not support languages ​​other than English.

OrthodoxWindows avatar Aug 01 '23 14:08 OrthodoxWindows