Share via

Default UTF-8 encoding for new Notepad documents

Anonymous
2010-04-27T22:42:11+00:00

Short of using a third party editor, is there a way to configure Notepad so that new documents are automatically saved in Unicode without having to change manually the encoding every single time from default ANSI to UTF-8?

Typical scenario:

  • Start typing some text with no extended characters
  • Save the file: It is automatically in ANSI
  • Open the file again to edit, add some extended characters, save again:

  Notepad tells you the extended characters will be lost if you confirm the save operation.

At least that last message offers the possibility to backup and "Save as" to choose UTF-8, but 1) this is very cumbersome, and 2) files with no extended characters will still be saved in ANSI by default.

Windows won't really be fully Unicode if the default Notepad encoding is still the obsolete ANSI code page, but, even if I reluctantly admit changing default behaviors is tricky for compatibility reasons, there should at least be a user option to select the default encoding for new documents, like other third party editors offer, such as Notepad++.

Currently, Windows forces me to replace Notepad file associations to use other text editors. Not a bad thing given the poor set of features in Notepad, but it would have been great to have this option in the standard O.S.

Windows for home | Previous Windows versions | Apps

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Anonymous
    2010-05-12T01:50:00+00:00
    1. Right click -> New -> Text Document
    2. Open "New Text Document.txt". Do NOT type anything!
    3. Go to "File -> Save As... " and choose UTF-8 under "Encoding:", press "Save" and overwrite existing file. Close the file.
    4. Rename "New Text Document.txt" to "TXTUTF-8.txt"
    5. Copy "TXTUTF-8.txt" to "C:\WINDOWS\SHELLNEW"
    6. Go to "Start -> Run..." and type

    regedit


    Press OK.

    1. Navigate to

    HKEY_CLASSES_ROOT.txt\ShellNew


    1. Right click in the right window -> New -> "String Value" and rename it to

    FileName


    1. Double click on "FileName" and put

    TXTUTF-8.txt


    into "Value data:" field and press OK.

    1. It's finished.
    2. Test it: Create new .txt document (Right click -> New -> Text Document). Open it and go to "File -> Save As... " and see that encoding is set by default to UTF-8 . :-)

    Credits go to Robert Clemenzi and his explanation of "FileName" string (and its linkage with "Template directory") within registry:

    http://mc-computing.com/WinExplorer/WinExplorerRegistry\_ShellNew.htm

    NOTE: These steps are ONLY for creating new and blank UTF-8 .txt documents. If .txt is already saved with ANSI encoding, it will stay ANSI when saving it next time - so if UTF-8 is needed (in this case), it must be set manually.

    P.S. Also change "fSavePageSettings" & "fSaveWindowPositions" DWORD values to "1" within following registry key:

    HKEY_CURRENT_USER\Software\Microsoft\Notepad

    Info: http://www.pc1news.com/saving-changes-to-notepad-configuration-1216.html

    200+ people found this answer helpful.
    0 comments No comments

48 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-12-05T03:52:53+00:00

    This is my simple way to set Notepad to save in Unicode by default on Windows 10:

    1. Open Notepad on and don't type anything.
    2. Go to File>Save As...
    3. In "File name" field type "Untitled.txt".
    4. Under "Encoding" choose "Unicode".
    5. Save file into C:\Folder.
    6. Go to the C:\Folder where you saved the file. 
    7. Right click on Untitled.txt and choose "Properties".
    8. In "General" tab check the "Read-only" checkbox and press "OK".
    9. Find the Windows Original "Notepad Shortcut Link" by going to Start > Window Accessories > Notepad.
    10. Right Click on "Notepad Icon", click on "More" and "Open file location".
    11. Right Click on "Notepad Shortcut Link" and choose "Properties".
    12. Add "C:\Untitled.txt" to the Target: %windir%\system32\notepad.exe

         To be %windir%\system32\notepad.exe "C:\Untitled.txt"

    1. Confirm the "Properties" window by pressing "OK";
    2. Right Click on "Notepad Shortcut Link" and choose "Pin to Taskbar" for your convenience to open at any time.

    That's all.

    Kawin BKK

    05/12/2016

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-12-05T03:47:34+00:00

    This is my simple way to set Notepad to save in Unicode by default on Windows 10:-

    1. Open notepad on and don't type anything.
    2. Go to File>Save As...
    3. In "File name" field type "Untitled.txt".
    4. Under "Encoding" choose "Unicode".
    5. Save file into C:\Folder.
    6. Go to the C:\Folder where you saved the file. 
    7. Right click on "Untitled.txt" and choose "Properties".
    8. In "General" tab check the "Read-only" checkbox and press "OK".
    9. Find the Windows's original "Notepad Shortcut Link" by going to Start > Window Accessories > Notepad.
    10. Right Click on "Notepad Icon", click on "More" and "Open file location".
    11. Right Click on "Notepad Shortcut Link" and choose "Properties".
    12. Add "C:\Untitled.txt" to the Target: %windir%\system32\notepad.exe

         To be %windir%\system32\notepad.exe "C:\Untitled.txt"

    1. Confirm the "Properties" window by pressing "OK";
    2. Right Click on "Notepad Shortcut Link" and choose "Pin to Taskbar" for your convenience to open it anytime.

    That's all.

    Kawin BKK

    05/12/2016

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2015-04-02T12:03:10+00:00

    Excellent instructions. Thank you IRIman.

    Also see this guide for getting the shortcut into the Start menu: http://answers.microsoft.com/en-us/windows/forum/windows\_7-files/how-can-i-add-shortcuts-to-the-windows-7-start/1aa5c179-79f2-4ab7-98d0-34ef49c7ddd1

    At least for me it then appeared in the "All Programs" menu option. I then dragged it back to the main view of the Start menu and to its top, which pinned it there and made it easily accessible.

    (Maybe there's an easier way to do that but it worked.)

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2014-07-05T19:40:40+00:00

    Hi Chimel,

    By default the encoding option in notepad is set to save as ANSI and there is no way to set UTF-8 as default. This is by design. If you wish to save the file and change the encoding, you will have to manually set the encoding to UTF-8.

    However, if you want to make a suggestion or give feedback about the product, you may access the link below and post it.

    https://connect.microsoft.com/default.aspx

    Thanks and Regards,

    Srinivas R Microsoft Support.

    Visit our Microsoft Answers Feedback Forum and let us know what you think.

    So I go there, and hey, there is apparently no way to make a suggestion for a change to Notepad.  Which is typical of Microsoft "support" in my experience: "We don't care, we don't have to."

    1 person found this answer helpful.
    0 comments No comments