I wanted to change the default of encoding in Notepad (ANSI) to UTF-8. According to following link went ahead and this work was done.
But still remains a problem. If create a text file, the default encoding is UTF-8 but if open the Notepad from Windows start menu's search, the default encoding of that is the ANSI.
Is there way for second mode that change the default encoding to UTF-8?
5 Answers
UTF-8 is now the default mode in Notepad since Windows 10 1903
Note
Firstly first I recommend you to simply use Notepad++ as a text editor or VSCode if you want a more developed one.
Explanation
But if you still wanna use Notepad for some reason, here is the way :
- Right click on Desktop, then choose New > Text Document
- A text file
New Text Document.txtis created. Don't type anything and open it. - Go to File > Save As... and choose UTF-8 under
Encoding:, pressSaveand overwrite the existing file. Close the file. - Rename
New Text Document.txttoTXTUTF-8.txt - Copy
"TXTUTF-8.txt"toC:\WINDOWS\SHELLNEW - Go to
Start > Run...and typeregeditand press ok - Navigate to
HKEY_CLASSES_ROOT\.txt\ShellNew - Right-click in the right window > New >
String Valueand rename it toFileName - Double click on
FileNameand putTXTUTF-8.txtintoValue data:field and press ok
Remember, whenever you want to open a blank utf-8 txt document you will have to right click > New > Text Document and work from there.
Modifying the registry can cause serious damage pay attention, please.
Source
From this thread.
Here is the Microsoft answer too
The solutions given at Microsoft forum involve either by creating a shortcut to a blank utf8 document, or opening a blank document from the context menu (by editing the registry & selecting New Text Document from 'New' menu).
Without going through the steps involved in setting up the above solutions (which does involve quite a few steps), I've come up with this one line code to type into Win CMD, giving a utf8 document containing one utf character in it (The utf char makes sure Windows saves it as utf8; can be any utf8 char with encoding above 0x127).
This character can be deleted before beginning/editing the document, and by default will be saved as utf8.
chcp 65001 & echo ♪>test.txt & notepad test.txtTested in Win 10 CMD
It's right in the Menu:
File > Encoding > Default
1Open Notepad. Go to 'format', 'font' and change 'script' to 'Central European'. Simple.
1