Page 1 of 1

How to auto-open a new textfile always in UTF-8 (NO BOM) encoding?

Posted: 09 Jul 2026 14:59
by pstein
For all my text files I use famous Notepad++ editor.
In NP++ preferences I setup UTF-8 (no BOM) as default encoding.

So when I open inside NP++ a new textfile via menu file-->new
then its UTF-8 encoded. Good.

Now when I right-click on a free background on right side of XYplorer and select context menu "New Text file" then NP++ opens and shows an empty.....ANSI encoded file
Bad.

How can I tell XYplorer to use the default settings of NP++ for the encoding?

Re: How to auto-open a new textfile always in UTF-8 (NO BOM) encoding?

Posted: 09 Jul 2026 17:52
by admin
1) "New Text file" does not open a file, it creates a file :?

2) an empty file has no encoding

Re: How to auto-open a new textfile always in UTF-8 (NO BOM) encoding?

Posted: 09 Jul 2026 19:23
by Horst
That's a function of your editor.
In my case it's PSPad which is set to make UTF-8 No BOM fies as default.
If I Open/Edit such a file created by the "New text file" function of XY
it automatically creates the required format from the 0 byte ANSI file
and saves the result as UTF-8 No BOM.

Re: How to auto-open a new textfile always in UTF-8 (NO BOM) encoding?

Posted: 10 Jul 2026 00:47
by RalphM
Or create an empty one with the right encoding and place it in the New Items folder.

Re: How to auto-open a new textfile always in UTF-8 (NO BOM) encoding?

Posted: 10 Jul 2026 11:16
by PeterH
For a test: in np++
- create a new/empty text file
- save and close it (still empty!)
- re-open in np++ and check coding shown
- I'd expect ANSI

Reason: as Don said an empty file has no encoding!
So your np++ should assume an empty file is UTF-8!

These days this should be true for every person, and for every editor!