New file from command line does not respect default encoding

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
markz
Posts: 2
Joined: Mon Mar 30, 2026 5:42 pm

New file from command line does not respect default encoding

Post by markz »

When I create a new file using the TextPad command line it does not respect the settings for "default encoding."

I have "default encoding" set to UTF-8 for the Default and Text document classes (among others). However when I start TextPad from the command line with the name of a non-existent file .. for example:

Code: Select all

> "C:\Program Files\TextPad\textpad.exe" baz.txt
.. it creates baz.txt with ANSI encoding instead of UTF-8.

If instead I create the file from within the editor with CTRL-N, the file is created with the expected UTF-8 encoding.

Is this expected behavior or a bug?
I am using TextPad 9.9.5.
User avatar
bbadmin
Site Admin
Posts: 1020
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: New file from command line does not respect default encoding

Post by bbadmin »

When you open a new document in TextPad, it does not have a file extension, so it takes the settings for the Default document class. When you open a non-existent file called baz.txt from the command line, and accept the prompt to create it, it will take the settings for the Text document class. Does this explain what you're seeing?
markz
Posts: 2
Joined: Mon Mar 30, 2026 5:42 pm

Re: New file from command line does not respect default encoding

Post by markz »

No, it does not. Allow me to quote from my original post:
I have "default encoding" set to UTF-8 for the Default and Text document classes
.. and ..
it creates baz.txt with ANSI encoding instead of UTF-8.
User avatar
bbadmin
Site Admin
Posts: 1020
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: New file from command line does not respect default encoding

Post by bbadmin »

I can reproduce this so it will be fixed in the next release. Thanks for reporting it.

You can work around it for now by doing the first save as a Save As and selecting UTF-8 as the encoding.
Post Reply