{"id":24126,"date":"2021-05-23T16:24:40","date_gmt":"2021-05-23T10:54:40","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=24126"},"modified":"2022-08-21T00:14:08","modified_gmt":"2022-08-20T18:44:08","slug":"set-default-encoding-notepad-ansi-utf-8","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/set-default-encoding-notepad-ansi-utf-8\/","title":{"rendered":"How to Change the Default Character Encoding in Notepad"},"content":{"rendered":"<p><em>This post explains how to change the default character encoding in Notepad (e.g., UTF-8 to ANSI) on Windows 10.<\/em><\/p>\n<p>ANSI has been the default encoding in Notepad in earlier versions of Windows 10. Since Windows 10 version 1903, the default Notepad encoding is UTF-8.<\/p>\n<p>When you launch <code>notepad.exe<\/code>, the default encoding is shown in Notepad&#8217;s status bar in Windows 10 v1903 and higher.<!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24127\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/notepad-character-encoding-default.png\" alt=\"notepad default character encoding windows 10\" width=\"394\" height=\"152\" \/><\/p>\n<p>When saving a file in Notepad in any version of Windows 10, you can choose one of these character encoding types:<\/p>\n<ul>\n<li>ANSI<\/li>\n<li>UTF-16 LE<\/li>\n<li>UTF-16 LE<\/li>\n<li>UTF-8 (default)<\/li>\n<li>UTF-8 with BOM<\/li>\n<\/ul>\n<figure id=\"attachment_24128\" aria-describedby=\"caption-attachment-24128\" style=\"width: 492px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-24128 size-full\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/notepad-character-encoding-list.png\" alt=\"notepad default character encoding windows 10\" width=\"502\" height=\"188\" \/><figcaption id=\"caption-attachment-24128\" class=\"wp-caption-text\"><em>(Refer to <a href=\"https:\/\/www.w3.org\/International\/questions\/qa-what-is-encoding\" target=\"_blank\" rel=\"noopener nofollow\">Character encodings<\/a> at w3.org.)<\/em><\/figcaption><\/figure>\n<p>UTF-8 is preferred if you want to use non-ASCII characters like <code>\u010c, \u0106, \u0160, \u00e4, \u00f6, \u00fc, \u00df<\/code> or symbols like \u2192 in your text file. Some of these accented characters will be lost if you save the file as ANSI. Notepad also warns you when you do so:<\/p>\n<pre class=\"err\">This file contains characters in Unicode format which will be lost if you save this file as an ANSI encoded text file. To keep the Unicode information, click Cancel below and then select one of the Unicode options from the Encoding drop down list. Continue?<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24132\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/wrong-encoding-warning-notepad.png\" alt=\"notepad ansi warning unicode\" width=\"523\" height=\"303\" \/><\/p>\n<p><strong>Some users need ANSI to be the default<\/strong><\/p>\n<p>There are users who want to change Notepad&#8217;s default encoding from UTF-8 to ANSI. For example, VBS\/WSH script coders may want ANSI as the default &#8211; because CScript.exe or WScript.exe can&#8217;t run UTF-8 encoded .vbs files.<\/p>\n<p>Let&#8217;s see how to change Notepad&#8217;s default encoding to ANSI or another encoding in Windows 10.<br \/>\n<!--more--><\/p>\n<h2>Change the Default Character Encoding in Notepad<\/h2>\n<p>To set the default encoding in Notepad, you can use the Registry Editor.<\/p>\n<ol>\n<li>Right-click Start, click Run. Type <code>regedit.exe<\/code> and click OK.<\/li>\n<li>Go to the following registry branch:\n<pre>HKEY_CURRENT_USER\\Software\\Microsoft\\Notepad<\/pre>\n<\/li>\n<li>From the Edit menu, click New \u2192 DWORD (32-bit) value<\/li>\n<li>Name the value as <code>iDefaultEncoding<\/code><\/li>\n<li>Double-click <code>iDefaultEncoding<\/code> and set its data to <code>1<\/code> (for ANSI).<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24129\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/notepad-character-encoding-registry.png\" alt=\"notepad default character encoding windows 10 registry\" width=\"502\" height=\"174\" \/><\/p>\n<pre>Here is the list of possible value data you can assign:\r\n1 = ANSI\r\n2 = UTF-16 LE\r\n3 = UTF-16 BE\r\n4 = UTF-8 BOM\r\n5 = UTF-8\r\n<\/pre>\n<\/li>\n<li>Exit the Registry Editor.<\/li>\n<li>Open a new instance of Notepad. You&#8217;ll see that the default encoding has changed to <code>ANSI<\/code> &#8212; which is reflected in the status bar.<\/li>\n<\/ol>\n<p><em>Note that the above registry setting applies only when you open a new Notepad instance by running Notepad.exe.\u00a0<\/em><em>If you open a text document previously saved in a different encoding, Notepad will open the file in the encoding specified in that file.<\/em><\/p>\n<p>Despite the above registry modification, when you use the Desktop New menu (New \u2192 Text document), the New Text Document.txt fill will use <code>UTF-8<\/code> anyway.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24130\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/txt-shellnew.png\" alt=\"notepad default character encoding windows 10 - shellnew\" width=\"562\" height=\"296\" \/><\/p>\n<h4>There is no workaround for that in Windows 10.<\/h4>\n<hr \/>\n<h3>Force UTF-8 as default for New Text Documents (older versions of Windows)<\/h3>\n<p>This is the opposite of the earlier method &#8211; changing the New Text Document&#8217;s default encoding to UTF-8 from ANSI. This method is for older (than v1903) versions of Windows 10 and earlier Windows OS.<\/p>\n<p>Clicking on Desktop \u2192 New \u2192 Text Document uses ANSI in earlier versions of Windows. However, using the template file method, we can force Windows to create the New Text Document in UTF-8. Follow these steps:<\/p>\n<ol>\n<li>Open Notepad as administrator.<\/li>\n<li>From the File menu, click Save.<\/li>\n<li>Choose <strong><code>UTF-8<\/code><\/strong> encoding from the dropdown list.<\/li>\n<li>Save the file as <code>template.txt<\/code> in <code>C:\\Windows\\ShellNew<\/code>.<\/li>\n<li>Close Notepad.<\/li>\n<li>Launch the Registry Editor (<code>regedit.exe<\/code>)<\/li>\n<li>Go to the following branch:\n<pre>HKEY_CLASSES_ROOT\\.txt\\ShellNew<\/pre>\n<\/li>\n<li>Create a new String (REG_SZ) value named <code>FileName<\/code><\/li>\n<li>Double-click <code>FileName<\/code> and set its data to:\n<pre>template.txt<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24131\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/notepad-encoding-template-file.png\" alt=\"notepad default character encoding windows 10 - shellnew\" width=\"632\" height=\"160\" \/><\/li>\n<li>Exit the Registry Editor.<\/li>\n<\/ol>\n<p>We&#8217;ve now created an UTF8-encoded template file and referenced it in the registry. Windows will use it when you create a new text document.<\/p>\n<ul>\n<li>Right-click desktop \u2192 click New \u2192 Text Document.<\/li>\n<li>Double-click the newly created document.<\/li>\n<\/ul>\n<p>If the above steps were executed correctly, you should see UTF-8 in the Notepad status bar.<\/p>\n<p><em>[Note that the reverse (UTF-8 to ANSI) is not possible using the template method, as Notepad will open an ANSI-encoded file in UTF-8 mode anyway. You may look for <a href=\"https:\/\/www.winhelponline.com\/blog\/replace-notepad-text-editor-notepad-plus-association\/\">Notepad alternatives<\/a> in that case.]<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post explains how to change the default character encoding in Notepad (e.g., UTF-8 to ANSI) on Windows 10. ANSI has been the default encoding in Notepad in earlier versions of Windows 10. Since Windows 10 version 1903, the default Notepad encoding is UTF-8. When you launch notepad.exe, the default encoding is shown in Notepad&#8217;s &#8230; <a title=\"How to Change the Default Character Encoding in Notepad\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/set-default-encoding-notepad-ansi-utf-8\/\" aria-label=\"Read more about How to Change the Default Character Encoding in Notepad\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[8],"tags":[441],"class_list":["post-24126","post","type-post","status-publish","format-standard","hentry","category-windows-10","tag-registry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":3220,"url":"https:\/\/www.winhelponline.com\/blog\/reset-wordpad-notepad-settings-defaults\/","url_meta":{"origin":24126,"position":0},"title":"How to Reset Notepad and WordPad to Default","author":"Ramesh","date":"June 7, 2016","format":false,"excerpt":"If you've changed the default font settings and other options in WordPad or Notepad and want to revert back to Windows default values, this post tells you how to do that. Reset Notepad settings If you've altered the default Notepad font or encoding (using the iDefaultEncoding registry value), the margin,\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"reset notepad store app","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/06\/notepad-uwp-app-reset.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3890,"url":"https:\/\/www.winhelponline.com\/blog\/automatically-take-screenshot-open-in-editor\/","url_meta":{"origin":24126,"position":1},"title":"Automatically Take a Screenshot and Open it in Editor","author":"Ramesh","date":"August 23, 2016","format":false,"excerpt":"Using the WinKey and PrintScreen keystroke is probably the fastest way to take a screenshot (and automatically save it to a file) of the entire screen in Windows 8 and Windows 10. When using this method, the screenshot image contains your entire screen, including the Taskbar and everything. And in\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"automatically take screenshot and editor","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/screenshot-and-editor.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/screenshot-and-editor.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/screenshot-and-editor.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/screenshot-and-editor.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":25848,"url":"https:\/\/www.winhelponline.com\/blog\/file-history-parameter-is-incorrect-error\/","url_meta":{"origin":24126,"position":2},"title":"[Fix] File History &#8220;The parameter is incorrect&#8221; Error","author":"Ramesh","date":"January 21, 2022","format":false,"excerpt":"File History may have been working all these years correctly. But, of late, you may have noticed that File History backups stopped working even though the File History settings page says the feature is turned on. To make it work again, users may attempt to clean up old versions of\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"file history not working - element not found error","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/01\/rename-file-history-xml.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/01\/rename-file-history-xml.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/01\/rename-file-history-xml.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":8738,"url":"https:\/\/www.winhelponline.com\/blog\/open-with-notepad-plus-right-click-menu-windows\/","url_meta":{"origin":24126,"position":3},"title":"Add &#8220;Open with Notepad++&#8221; to the Right-Click Menu","author":"Ramesh","date":"April 19, 2019","format":false,"excerpt":"Many users have replaced Notepad with Notepad++ as the default text editor on their computers. Others use Notepad++ only when needed, and launch it via the Open with menu and choose Notepad++ from the list of options. This post tells you how to add the Open with Notepad++ command to\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"Notepad++ right-click menu in Windows","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":24227,"url":"https:\/\/www.winhelponline.com\/blog\/associate-file-no-extension-program\/","url_meta":{"origin":24126,"position":4},"title":"How to Associate a Program with Files that have No Extension","author":"Ramesh","date":"June 18, 2021","format":false,"excerpt":"Shell extensions for file names with no file extension can be registered under the following: [HKEY_CLASSES_ROOT\\.] For example, to associate a program (for example, Notepad.exe) to open all files with no extension, use the following registry keys: [HKEY_CLASSES_ROOT\\.] @=\"\" [HKEY_CLASSES_ROOT\\.\\shell] [HKEY_CLASSES_ROOT\\.\\shell\\open] [HKEY_CLASSES_ROOT\\.\\shell\\open\\command] @=\"<path to notepad.exe> %1\" Here is an alternative\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"associate extension-less files with a program","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/06\/associate-extension-less-files-2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":185,"url":"https:\/\/www.winhelponline.com\/blog\/vbscript-files-open-with-notepad\/","url_meta":{"origin":24126,"position":5},"title":"[Fix] VBScript Files Open With Notepad","author":"Ramesh","date":"April 16, 2008","format":false,"excerpt":"When you try to run a VBScript by double-clicking it, the script may open in Notepad. This happens if the user has set Notepad as the default (instead of wscript.exe) program for .vbs files, using Open with or through any other methods.. [Fix] VBScript Files Open With Notepad Running VBScript\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"vbs files open in notepad","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/04\/vbsopen.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/04\/vbsopen.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/04\/vbsopen.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/24126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=24126"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/24126\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=24126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=24126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=24126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}