Forum Discussion
Notepad Default encoding UTF8 Windows 10 Version 1903
Hi,
- use Notepad++ which is free
- OR use registry hack:
- Right click on Desktop, then choose New > Text Document
- A text file New Text Document.txt is created. Don't type anything and open it.
- Go to File > Save As... and choose UTF-8 under Encoding:, press Save and overwrite the existing file. Close the file.
- Rename New Text Document.txt to TXTUTF-8.txt
- Copy "TXTUTF-8.txt" to C:\WINDOWS\SHELLNEW
- Go to Start > Run... and type regedit and press ok
- Navigate to HKEY_CLASSES_ROOT\.txt\ShellNew
- Right-click in the right window > New > String Value and rename it to FileName
- Double click on FileName and put TXTUTF-8.txt into Value 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.
- lexikosSep 27, 2019Copper Contributor
HotCakeXYour instructions are for creating a UTF-8 template document to make UTF-8 a sort of default, which is the opposite of what the OP asked for. UTF-8 is already the default.
This technique will not work if the template file is empty or contains only ASCII text, as it would be byte-for-byte identical in ANSI and UTF-8. Notepad will just use its default encoding, either ANSI or UTF-8 depending on the version
The template file will only be identified with the original encoding if it contains something that causes Notepad to recognize the encoding, such as a UTF-8 BOM (but the OP wants ANSI, not UTF-8), or an ANSI multi-byte sequence that cannot be reinterpreted as valid UTF-8. For example, a text file containing only "µ" encoded as ANSI (for code page 1252, anyway) will correctly be identified as ANSI.
Of course, there's no need to worry about UTF-8 vs. ANSI in the first place if every file contains only ASCII text.
- salclem2Oct 28, 2019Copper Contributor
"Of course, there's no need to worry about UTF-8 vs. ANSI in the first place if every file contains only ASCII text."
Wrong. If you write for example "è" in notepad, when you open the file with another text editor, you will see "è" and not "è". Then, there's need to worry about UTF-8 vs ANSI, because "è" has his ASCII code, i.e. 232
- Simon_HooperOct 02, 2020Copper Contributor
@lexikos Actually ".............if every file contains only ASCII text." is correct. ASCII is a 7 bit encoding. Code 232 is not ASCII which is the point of salclem2 comment.