7
  • I have a file with the following code: print "Hello World".

  • In Encoding section (Notepad++ Menu), Encode in UTF-8 is chosen.

  • I close the file, and open it again: nothing has been changed. Perfect.

  • I add some Unicode character, so the code now is: print "Hello World ".

  • I close the file, and open it again; I see: print "Hello World рџЂ".

  • In Encoding section, Encode in ANSI is chosen.

  • Once I forget to change it back to Encode in UTF-8, and start typing something, all Unicode characters are lost.

Any changes to Settings -> Preferences -> New Document -> Encoding as well as to // MISC. -> Autodetect character encoding change nothing for me.

Is there any way to force Notepad++ 7.3.2 to open all files in UTF-8?

A. Eaxon
  • 157
  • 2
  • 7
  • Good reproduction steps. I have the same behavior and the only way to prevent it was to save the file in UTF-8 with BOM. I think it is due to that particular emoji. If I put Chinese in the file it opens correctly. Seems to be a bug in Notepad++ UTF-8 detection. – Mark Tolonen Feb 20 '17 at 17:27
  • If your toolchain barfs on a BOM, but not UTF-8 in a string literal or comment, you might try putting a BOM inside a comment at the start of the file. If UTF-8 with BOM just works, though, use that. – Davislor Feb 27 '17 at 06:53
  • As I see it, the problem starts with the files not being saved in the right encoding. For example, if I save a file in GB2312 (simplified chinese) and reopen the file, it will open in ANSII. I just have to change back the encoding manually and everything is ok. But if I save it in UTF-8, it will always open UTF-8. But I might be wrong. – Binar Web May 31 '18 at 08:46

1 Answers1

1

I can't reproduce your problem, maybe because of a newer version and a new setting "Apply to opened files":

enter image description here

knut
  • 27,320
  • 6
  • 84
  • 112