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

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
pstein
Posts: 71
Joined: 11 Dec 2021 21:11

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

Post 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?

admin
Site Admin
Posts: 66361
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post by admin »

1) "New Text file" does not open a file, it creates a file :?

2) an empty file has no encoding

Horst
Posts: 1388
Joined: 24 Jan 2021 12:27
Location: Germany

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

Post 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.
Windows 11 Home, Version 25H2 (OS Build 26200.8737)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1416b (x64), Everything Toolbar 2.4.1, Listary Pro 7.0.0.3 beta

RalphM
Posts: 2090
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

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

Post by RalphM »

Or create an empty one with the right encoding and place it in the New Items folder.
Ralph :)
(OS: W11 25H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

PeterH
Posts: 2828
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

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

Post 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!

Post Reply