Page 1 of 1

New file from command line does not respect default encoding

Posted: Mon Mar 30, 2026 6:13 pm
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.

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

Posted: Tue Mar 31, 2026 2:57 pm
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?

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

Posted: Thu Apr 02, 2026 5:21 pm
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.

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

Posted: Fri Apr 03, 2026 2:10 pm
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.