Shift+F4 Notepad UFT-8 with BOM
Moderators: Hacker, petermad, Stefan2, white
Shift+F4 Notepad UFT-8 with BOM
I have set Notepad.exe as a default editor for Shift + F4 (which is the default).
I have set default encoding in Notepad.exe as UTF-8 with BOM. So when I open/create new *.txt file this encoding is used.
But using Shift + F4 the encoding is UTF-8 WITHOUT BOM.
How can I set UTF-8 with BOM defalt encoding for Shft + F4?
I don't want to use other text editors like Notepad++ or Notepad2, thought.
I have set default encoding in Notepad.exe as UTF-8 with BOM. So when I open/create new *.txt file this encoding is used.
But using Shift + F4 the encoding is UTF-8 WITHOUT BOM.
How can I set UTF-8 with BOM defalt encoding for Shft + F4?
I don't want to use other text editors like Notepad++ or Notepad2, thought.
Re: Shift+F4 Notepad UFT-8 with BOM
When you edit a text file you keep the current format in notepad. If you want to change encoding, just do it on save.
Default encoding, is used when creating a new file and not to change file encoding...
Default encoding, is used when creating a new file and not to change file encoding...
Re: Shift+F4 Notepad UFT-8 with BOM
OK, let me clear what I am doing. I use Shift + F4 and type name for NEW file. I am NOT editing existing one.
When I go to Save as..encoding is UTF-8 and not UTF-8 with BOM what I want and what is set as default in Notepad.
So I need to change it om every single save procedure...which is strongly inefficient as I'am creating a lot of files this way.
When I go to Save as..encoding is UTF-8 and not UTF-8 with BOM what I want and what is set as default in Notepad.
So I need to change it om every single save procedure...which is strongly inefficient as I'am creating a lot of files this way.
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Shift+F4 Notepad UFT-8 with BOM
When you use Shift+F4, TC creates a new empty file and then opens it with the configured editor. Since the file is completely empty (and also has no BOM), I guess that Notepad sees it as a UTF-8 file without BOM.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: Shift+F4 Notepad UFT-8 with BOM
2ghisler(Author)
jericzech is already aware of this, or doesn't care about underlying technical details. That's why they asked:
jericzech is already aware of this, or doesn't care about underlying technical details. That's why they asked:
and not "Why does Notepad open the new file created with Shift+F4 as UTF-8 without BOM?"

Re: Shift+F4 Notepad UFT-8 with BOM
Do you mean that you can type
Code: Select all
notepad newfile.txt
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: Shift+F4 Notepad UFT-8 with BOM
@elgonzo - thanks, you are right
@Usher - when I click Create new > Text file anywhere in Windows context menu ... and right after the new file opens I hit Save as...I see UTF-8 with BOM (without any characters in it)...I am not at the computer right now but I check your method asap
@Usher - when I click Create new > Text file anywhere in Windows context menu ... and right after the new file opens I hit Save as...I see UTF-8 with BOM (without any characters in it)...I am not at the computer right now but I check your method asap
Re: Shift+F4 Notepad UFT-8 with BOM
2jericzech
Hmm, in my Windows 7 and 8.1 Shift+F4 opens Notepad in ANSI mode, whereas in my WIndows 10 it opens in UTF-8 mode (no BOM). Which version of Windows are you using?
Hmm, in my Windows 7 and 8.1 Shift+F4 opens Notepad in ANSI mode, whereas in my WIndows 10 it opens in UTF-8 mode (no BOM). Which version of Windows are you using?
Where do you set that - by editing Windows' Registry?I have set default encoding in Notepad.exe as UTF-8 with BOM
I dont see a "Create new" item in the context menu of neither TC nor Windows File Explorer nor the Desktop. There is a "New" submenu, where I can choose "Text Document" - but this function creates a new file, but it does NOT open it. If I, after it is created, open it in Notepad, the "Save as" defaults to UTF-8 (in Windows 10)when I click Create new > Text file anywhere in Windows context menu ... and right after the new file opens
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: Shift+F4 Notepad UFT-8 with BOM
2petermad
1. Only newest Windows 10 builds have UTF-8 without BOM added to Notepad, it's quite new change.
2. Older Windows 10 builds have only UTF-8 with BOM described simply "UTF-8" - like in older Windows versions.
3. In older Windows versions ANSI is default setting and you can't change it.
1. Only newest Windows 10 builds have UTF-8 without BOM added to Notepad, it's quite new change.
2. Older Windows 10 builds have only UTF-8 with BOM described simply "UTF-8" - like in older Windows versions.
3. In older Windows versions ANSI is default setting and you can't change it.
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: Shift+F4 Notepad UFT-8 with BOM
You can create your own command and assign Shift+F4 to that user defined command. Or Shift+Alt+F4, or...
FAQs: User-Defined Command (UDC) (usercmd.ini) em_command
- Create own commands to use in button or to execute them by an keyboard shortcut.
viewtopic.php?p=344777#p344777
We have done that already sometimes exactly as you need,... can be found in the forum...
I will see if I find it.
EDIT:
here is something for example > viewtopic.php?p=346569#p346569
How to:
- have your wanted file as a template
- use such an script to create an user defined command with
- assign an keyboard shortcut to that UDC to execute that script
- press the shortcut and the file template will be copied into the current active folder
Re: Shift+F4 Notepad UFT-8 with BOM
2Usher
Funny thing: In Danish Windows 10, BOM is tranlated to "STYKLISTE" which means "Bill of Materials" (A list of the components and subassemblies needed to build one unit of a product) in stead of meaning "Byte Order Mark" - so Mikey$oft used a machine translation for BOM (and even capitalized the whole word to mimic BOM) - hilarious
I know that - that is why I am asking jericzech how he has managed to set default encoding in Notepad.exe as UTF-8 with BOM2petermad
1. Only newest Windows 10 builds have UTF-8 without BOM added to Notepad, it's quite new change.
2. Older Windows 10 builds have only UTF-8 with BOM described simply "UTF-8" - like in older Windows versions.
Funny thing: In Danish Windows 10, BOM is tranlated to "STYKLISTE" which means "Bill of Materials" (A list of the components and subassemblies needed to build one unit of a product) in stead of meaning "Byte Order Mark" - so Mikey$oft used a machine translation for BOM (and even capitalized the whole word to mimic BOM) - hilarious

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
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Shift+F4 Notepad UFT-8 with BOM
I think the only way to do that would be to use an older version of notepad.exe. You don't need to replace the one in Windows, just put it anywhere else and link to it via menu Configuration - Options - Edit/View.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Shift+F4 Notepad UFT-8 with BOM
This helps in similiar cases:
Notepad of Windows 10 newer releases has the default UTF-8 without BOM.
Older versions had UTF-8 with BOM as a default.
Very old versions saved only ANSI without other alternativs.
You can change the default behave in Windows Registry:
1. Open registry using regedit.exe
2. Go to key HKEY_CURRENT_USER \ Software \ Microsoft \ Notepad
3. Create new DWORD (32-bit) key with name "iDefaultEncoding"
4. Possible values:
1 = ANSI
2 = UTF-16 LE
3 = UTF-16 BE
4 = UTF-8 mit BOM
5 = UTF-8
[By best knowledge, worked for me, but I'm not Doctor Perfect
]
But this doesn't help using Shift-F4 creating a new text file, because then notepad loads an existing file with zero length, which of course can't contain a 3 bytes long BOM. Result: Very new Notepad assumes an UTF-8 file without BOM, because this is the internal non-overwritten default.
Eventually newer (but not newest! - see above) notepad.exe could help, but I'm not 100% sure, try it!
Notepad of Windows 10 newer releases has the default UTF-8 without BOM.
Older versions had UTF-8 with BOM as a default.
Very old versions saved only ANSI without other alternativs.
You can change the default behave in Windows Registry:
1. Open registry using regedit.exe
2. Go to key HKEY_CURRENT_USER \ Software \ Microsoft \ Notepad
3. Create new DWORD (32-bit) key with name "iDefaultEncoding"
4. Possible values:
1 = ANSI
2 = UTF-16 LE
3 = UTF-16 BE
4 = UTF-8 mit BOM
5 = UTF-8
[By best knowledge, worked for me, but I'm not Doctor Perfect

But this doesn't help using Shift-F4 creating a new text file, because then notepad loads an existing file with zero length, which of course can't contain a 3 bytes long BOM. Result: Very new Notepad assumes an UTF-8 file without BOM, because this is the internal non-overwritten default.
Eventually newer (but not newest! - see above) notepad.exe could help, but I'm not 100% sure, try it!