5

There is a known bug in notepad where occasionally files which open completely normally in notepad++, wordpad, etc, open as Chinese characters in notepad.

screenshot of bug

Copy pasting the contents of the file (from notepad++ to a fresh document) will still produce Chinese characters in notepad. Changing the file name will still produce Chinese characters in notepad. Forcibly changing the encoding has no effect.

Inserting or removing a single character (in notepad++) does fix the problem (until the change is reversed, and then the problem returns), however we are not aware of a way to know in advance which files would benefit from the insertion of an extraneous space, versus files where the insertion of the space would itself trigger the bug.

We would like to ensure that the files we create and save do not trigger this bug. The method must be compatible with Windows and Linux machines.

Has anyone else encountered this and found a reliable way of preventing triggering the bug?

(note: the file in question, when examined in a binary editor, contains only ASCII characters, nothing else. this is not binary data slipping in)

Noor A Shuvo
  • 2,639
  • 3
  • 23
  • 48
dWitty
  • 494
  • 9
  • 22
  • To anyone who wants to try to debug this, do the following to replicate the issue: 1) Right-click in any directory where you have write access and select New > Text Document. 2) Paste the following text into the document and save (9 repetitions of `test teste a`, any number of repetitions more than that will produce the same issue): `test teste atest teste atest teste atest teste atest teste atest teste atest teste atest teste atest teste a`. 3) Close and open the file, and you'll see Chinese characters. – wmjdgla Mar 19 '23 at 15:06

1 Answers1

0

I encountered it as well and decided to simply ignore Notepad.

A solution which also works for Notepad is to save the content in UTF.

draz
  • 793
  • 6
  • 10
  • btw: My file contains mainly a whitespace separated table of numbers in ASCII as well. – draz Apr 12 '22 at 13:34