<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to set "UTF-8 WITH BOM" as default Encoding even for old but changed textfiles?]]></title><description><![CDATA[<p dir="auto">As I found out I can change the default encoding for new text documents in</p>
<p dir="auto">Preferences—New Document—Encoding</p>
<p dir="auto">by enabling “UTF-8 with BOM”</p>
<p dir="auto">Unfortunately this works only for new, really new documents.</p>
<p dir="auto">When I load an existing old file (with UTF-8 only), then change something and save it, the old encoding remains.</p>
<p dir="auto">How can I tell NP++ to apply the new default encoding to changed old files too?</p>
<p dir="auto">If possible an additional option for this should be added to the next release.</p>
<p dir="auto">Thank you</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27475/how-to-set-utf-8-with-bom-as-default-encoding-even-for-old-but-changed-textfiles</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 23:11:08 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27475.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Mar 2026 08:45:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to set "UTF-8 WITH BOM" as default Encoding even for old but changed textfiles? on Mon, 30 Mar 2026 21:02:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-svenson" aria-label="Profile: Claudia-Svenson">@<bdi>Claudia-Svenson</bdi></a> said in <a href="/post/105105">How to set "UTF-8 WITH BOM" as default Encoding even for old but changed textfiles?</a>:</p>
<blockquote>
<p dir="auto">This would be a great convenient enhancement feature.</p>
</blockquote>
<p dir="auto">Natively, there is no such feature (and it’s not likely to happen, IMO).</p>
<p dir="auto">Using a plugin, it’s doable.  For now, it requires using a not-yet-released version of the EditorConfig plugin, but they are supposedly eventually going to release a new version with all the features/fixes from the last 6 years.</p>
<p dir="auto">EditorConfig plugin <em>should</em> be able to handle the <code>charset</code> attribute.  But the version available in Plugins Admin is still 6 years old, and does not include that attribute.  They merged <a href="https://github.com/editorconfig/editorconfig-notepad-plus-plus/pull/50" rel="nofollow ugc">the PR that implemented charset</a> in 2023, but have not done a release since v0.4.0.0 in 2019.  (In October 2025, they put in an <a href="https://github.com/editorconfig/editorconfig-notepad-plus-plus/issues/68" rel="nofollow ugc">Issue</a> to encourage themselves to do a release, but there’s still apparently a showstopper preventing them from moving forward.)</p>
<p dir="auto">I just forked their repo, and did a build based on their most recent codebase; I call that “0.4.0.1”, so that there’s something to distinguish it from the official version.  For a couple of months from 2026-Mar-30, GitHub should have some <a href="https://github.com/pryrt/npp-editorconfig-plugin/actions/runs/23767310769#artifacts" rel="nofollow ugc">artifacts of my v0.4.0.1 build</a>.</p>
<ul>
<li>Exit Notepad++</li>
<li>Go to <a href="https://github.com/pryrt/npp-editorconfig-plugin/actions/runs/23767310769#artifacts" rel="nofollow ugc">https://github.com/pryrt/npp-editorconfig-plugin/actions/runs/23767310769#artifacts</a> and download the right artifact for your machine (most likely the one ending in <code>--x64</code>).</li>
<li>Unzip, and copy the DLL to <code>c:\Program Files\Notepad++\Plugins\NppEditorConfig\NppEditorConfig.dll</code></li>
<li>create <code>.editorconfig</code> file at the top of your document structure (like <code>c:\users\username\.editorconfig</code>), populate it with:<pre><code>root = true

[*.bat]
charset = utf-8

[*.py]
charset = utf-8

[*.txt]
charset = utf-8-bom

[*.ps1]
charset = utf-8-bom
</code></pre>
</li>
<li>The next time you save a file with one of those extensions (as long as it’s in the same folder as the <code>.editorconfig</code> file, or a subdirectory of that folder), it will use the charset indicated when you save the file in Notepad++</li>
</ul>
<p dir="auto"><em>(GitHub will remove those artifacts sometime in the next few months.  If EditorConfig hasn’t done an official release since then, and the files are gone, feel free to ping me here, and I can trigger a new build to GitHub)</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/105110</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105110</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 30 Mar 2026 21:02:10 GMT</pubDate></item><item><title><![CDATA[Reply to How to set "UTF-8 WITH BOM" as default Encoding even for old but changed textfiles? on Mon, 30 Mar 2026 15:37:13 GMT]]></title><description><![CDATA[<p dir="auto">The problem is that it is highly recommended to store</p>
<p dir="auto">Powershell scripts with .ps1 extension</p>
<p dir="auto">and (sometimes)</p>
<p dir="auto">pure textfiles (ith .txt eextension</p>
<p dir="auto">as UTF-8 with BOM.</p>
<p dir="auto">In contrast it is urgently required to store</p>
<p dir="auto">DOS batch scripts with .bat extension</p>
<p dir="auto">and</p>
<p dir="auto">Python scripts with .py extension</p>
<p dir="auto">as UTF-8 WITHOUT BOM.</p>
<p dir="auto">I cannot count how many times I hat the wrong encoding and experienced some weird execution problems.<br />
Since I oftentimes use Notepad++ as initial script editor it would be the best place to auto-adjust Encoding here.</p>
<p dir="auto">Can I somehow let NP++ me warn when it detects a bad Encoding (depending on the current file extension) and suggest a switch? Even when I rename or edit an existing file?</p>
<p dir="auto">This would be a great convenient enhancement feature.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105105</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105105</guid><dc:creator><![CDATA[Claudia Svenson]]></dc:creator><pubDate>Mon, 30 Mar 2026 15:37:13 GMT</pubDate></item><item><title><![CDATA[Reply to How to set "UTF-8 WITH BOM" as default Encoding even for old but changed textfiles? on Fri, 27 Mar 2026 12:27:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-svenson" aria-label="Profile: Claudia-Svenson">@<bdi>Claudia-Svenson</bdi></a> said in <a href="/post/105068">How to set "UTF-8 WITH BOM" as default Encoding even for old but changed textfiles?</a>:</p>
<blockquote>
<p dir="auto">When I load an existing old file (with UTF-8 only), then change something and save it, the old encoding remains.</p>
<p dir="auto">How can I tell NP++ to apply the new default encoding to changed old files too?</p>
</blockquote>
<p dir="auto">I think you mean you want this to be automatic; but just in case you missed it, you can change the encoding of the file while you are editing it using <strong>Encoding</strong> | <strong>Convert to UTF-8-BOM</strong>. You just have to think to do it for every file you want to change.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105071</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105071</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Fri, 27 Mar 2026 12:27:10 GMT</pubDate></item><item><title><![CDATA[Reply to How to set "UTF-8 WITH BOM" as default Encoding even for old but changed textfiles? on Fri, 27 Mar 2026 10:20:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-svenson" aria-label="Profile: Claudia-Svenson">@<bdi>Claudia-Svenson</bdi></a> said:</p>
<blockquote>
<p dir="auto">How can I tell NP++ to apply the new default encoding to changed old files too?</p>
</blockquote>
<p dir="auto">I don’t believe this is possible.</p>
<blockquote>
<p dir="auto">If possible an additional option for this should be added to the next release.</p>
</blockquote>
<p dir="auto">This is IMO a dubious need.</p>
<hr />
<p dir="auto">For your use, perhaps a script that does an encoding conversion upon save would be beneficial?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105069</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105069</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 27 Mar 2026 10:20:49 GMT</pubDate></item></channel></rss>