[SOLVED] Use UTF-8 with byte-order mark when creating a new .txt file
Moderators: Hacker, petermad, Stefan2, white
Re: Use UTF-8 with byte-order mark when creating a new .txt file
2tuska
nice decision! and it's doable)) and looks workable)))
nice decision! and it's doable)) and looks workable)))
#146217 personal license
Re: Use UTF-8 with byte-order mark when creating a new .txt file
Thanks go to white, who put me on the right track and also to other users
whose advice made me pay attention in the first place.

Re: Use UTF-8 with byte-order mark when creating a new .txt file
That's not my suggestion.tuska wrote: 2024-02-07, 18:34 UTC With your suggestion:
cm_edit /CT
S+F4=em_UTF-16LE_with_Signature (only example)
I get this message:
"Enter file name to edit:"
I don't see why you need this.
When I store an anyname.txt template file with your wanted encoding,
there is no problem with the simple Shift-F4 definition
cm_edit /CT
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Use UTF-8 with byte-order mark when creating a new .txt file
2tuska
If you use cm_edit /CT the template file has to be located in Windows' default template directory - usually %APPDATA%\Microsoft\Windows\Templates = %$Templates%
Some sources say the Windows' templates directory is in APPDATA%\Microsoft\Templates so I guess the best way to find the dir is by using cd %$Templates%
There is also a Junction (LNK) to the Templates folder in %USERPROFILE% but it will have a localized name (Skabeloner in Danish).
If you use cm_edit /CT the template file has to be located in Windows' default template directory - usually %APPDATA%\Microsoft\Windows\Templates = %$Templates%
Some sources say the Windows' templates directory is in APPDATA%\Microsoft\Templates so I guess the best way to find the dir is by using cd %$Templates%
There is also a Junction (LNK) to the Templates folder in %USERPROFILE% but it will have a localized name (Skabeloner in Danish).
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Use UTF-8 with byte-order mark when creating a new .txt file
I made a link Templates to the Microsoft templates under the TC home dir.petermad wrote: 2024-02-08, 12:41 UTC 2tuska
If you use cm_edit /CT the template file has to be located in Windows' default template directory - usually %APPDATA%\Microsoft\Windows\Templates = %$Templates%
Some sources say the Windows' templates directory is in APPDATA%\Microsoft\Templates so I guess the best way to find the dir is by using cd %$Templates%
There is also a Junction (LNK) to the Templates folder in %USERPROFILE% but it will have a localized name (Skabeloner in Danish).
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Use UTF-8 with byte-order mark when creating a new .txt file
2petermad
Windows' default template directory - %$Templates% was the solution!
Many thanks for your support!
2Horst.Epp
as I have never stored a template in this directory.
Now that I know the/your solution, I can say: Of course you can also solve the issue this way
Thanks!
cd %$Templates% - C:\Users\user\AppData\Roaming\Microsoft\Windows\Templates\
usercmd.ini
wincmd.ini
Windows' default template directory - %$Templates% was the solution!
Many thanks for your support!
2Horst.Epp
I have unfortunately overlooked the note in the help: "By default, the user's template directory will be used.",Horst.Epp wrote: 2024-02-08, 10:26 UTC When I store an anyname.txt template file with your wanted encoding,
there is no problem with the simple Shift-F4 definition
cm_edit /CT
as I have never stored a template in this directory.
Now that I know the/your solution, I can say: Of course you can also solve the issue this way

Thanks!
cd %$Templates% - C:\Users\user\AppData\Roaming\Microsoft\Windows\Templates\
Code: Select all
C:\Users\user\AppData\Roaming\Microsoft\Windows\Templates\UTF-8-BOM.txt
C:\Users\user\AppData\Roaming\Microsoft\Windows\Templates\z_UTF-16LE with Signature.txt
Code: Select all
[em_UTF-8-BOM_Shift-F4_%$Templates%_cm_edit_CT]
button=
cmd=cm_edit
param=/CT
menu=cm_edit /CT || cd %$Templates%|https://www.ghisler.ch/board/viewtopic.php?p=449648#p449648|https://www.ghisler.ch/board/viewtopic.php?p=449747#p449747 Use UTF-8 with byte-order mark when creating a new .txt file
Code: Select all
[Shortcuts]
S+F4=em_UTF-8-BOM_Shift-F4_%$Templates%_cm_edit_CT
;S+F4=em_UTF-8-BOM_Shift-F4_%$Templates%_cm_edit_CT https://www.ghisler.ch/board/viewtopic.php?p=449747#p449747 petermad: If you use cm_edit /CT the template file has to be located in Windows' default template directory - usually %APPDATA%\Microsoft\Windows\Templates = %$Templates%
Re: Use UTF-8 with byte-order mark when creating a new .txt file
For me, the issue is solved.
Thanks again for your support.
@Moderator
Please add [SOLVED] in the first post (I am not allowed to do that in this case).
Perhaps this post should be moved to the "Total Commander (English)" forum?
Thanks again for your support.
@Moderator
Please add [SOLVED] in the first post (I am not allowed to do that in this case).
Perhaps this post should be moved to the "Total Commander (English)" forum?
Re: Use UTF-8 with byte-order mark when creating a new .txt file
You can edit the post making the moderator message no longer relevant and remove the moderator message.tuska wrote: 2024-02-12, 15:38 UTC @Moderator
Please add [SOLVED] in the first post (I am not allowed to do that in this case).
Moderator message from: white » 2024-02-12, 16:32 UTC
Done.tuska wrote: 2024-02-12, 15:38 UTC Perhaps this post should be moved to the "Total Commander (English)" forum?