Bug: Empty file with UTF-8 encoding saved as ANSI
-
Assume I open NP++ and create a new file via menu
file—>new
In the lower right corner the Encoding is “UTF-8” which is equal to my default encoding.
GoodNow I save this empty, unchanged file as “new 1.txt” and close NP++.
Afterwards I reopen this file “new 1.txt” by double click…and the Encoding now switched to ANSI.
Very badI guess this is a bug in NP++
I oftentimes create empty files in Filemanager and fill them later with stuff.
And I always want have UTF-8 Encoding (until I switch this manually).
How can I enforce this in NP++? -
The problem is that neither ANSI nor UTF-8 includes a “marker” within the file itself to indicate the encoding type. This means Notepad++ or any other editor has to determine the encoding based on the file’s content. Consequently, with an empty file, it is impossible to distinguish which encoding is intended.
That is precisely why this setting exists (see screenshot). Checking that box should do the trick.

-
Screenshot with englisch lang:

-
ok, thank you. This works.
I must have been blind to not see that sub option.
Possibly it was introduced only recently -
Possibly it was introduced only recently
Nope.
But it isn’t exactly obvious what its function is, based only upon the UI text.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login