New files created via shift+F4 are always ASCI, I want UTF-8

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

New files created via shift+F4 are always ASCI, I want UTF-8

Post by *avada »

Hi!

So, can I change this? It always opens in notepad++ with ANSI encoding, even though the file is 0b size and I have set the default fromat to UTF-8.

Any tips?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6495
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

I have set-up Syn2 as Notepad replacement
with the help of NodePadReplacer
https://www.binaryfortress.com/NotepadReplacer/
So Syn2 is used even for hardcoded Notepad calls.
In Syn2 I can set the default for new text files.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

avada,
Shift+F4 creates empty file, so there is no any encoding in this file at all, and it is up to your text editor which encoding will be used for empty files.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6495
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

MVV wrote:avada,
Shift+F4 creates empty file, so there is no any encoding in this file at all, and it is up to your text editor which encoding will be used for empty files.
The problem with TC is that you can define an Editor but it isn't used
in Shift-F4 or even in the direct editing of config files.
I don't see any real technical reason for this design decision.
Fortunately tools like NotePadReplacer help to overcome this anoying detail.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2Horst.Epp
Of course the editor set in TC is used when creating new files with Shift+F4! I have set ConTEXT as my primary text editor and ConTEXT is called with the file name created by Shift+F4.

However, you are right about the direct editing of the config files. I can't understand either why TC opens them in Notepad instead of the editor set in TC.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6495
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Dalai wrote:2Horst.Epp
Of course the editor set in TC is used when creating new files with Shift+F4! I have set ConTEXT as my primary text editor and ConTEXT is called with the file name created by Shift+F4.

However, you are right about the direct editing of the config files. I can't understand either why TC opens them in Notepad instead of the editor set in TC.

Regards
Dalai
You are right with the Shift-F4 :oops:
I did some tests long time ago and don't remember what was wrong with it.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Post by *avada »

MVV wrote:avada,
Shift+F4 creates empty file, so there is no any encoding in this file at all, and it is up to your text editor which encoding will be used for empty files.
I see. Well, that's that then.
I guess I can't get TC to make an empty UTF-8 text file?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I see. Well, that's that then.
I guess I can't get TC to make an empty UTF-8 text file?
If you really want to create an UTF-8 empty file, you can make a template of such file and some kind of button that will copy that template with desired name. But I'm almost sure that Notepad++ allows defining default encoding for empty files.
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Notepad++ can set the encoding for new files, i.e. files created within the program: Settings > Preferences > New Document > Encoding. But that doesn't seem to affect existing empty files. So you'd need to go the template way.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Post by *avada »

Dalai wrote:Notepad++ can set the encoding for new files, i.e. files created within the program: Settings > Preferences > New Document > Encoding. But that doesn't seem to affect existing empty files. So you'd need to go the template way.

Regards
Dalai
That's the base of the problem. It's a bug they're doing their best to ignore, it seems.

What do you mean by "template way"?
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2avada
As MVV already pointed out, create some file that fits your needs (the template) and save it to some directory. Create a button in TC that copies that very file to the new name and opens it in your editor. You could even integrate this file into the "New" submenu of the context menu by copying the template to %SystemRoot%\ShellNew (although I'm not sure this works on Vista and higher).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply