<?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[Is there a serious reason why a "user-defined language" cannot specify the encoding?]]></title><description><![CDATA[<p dir="auto">I frequently use Notepad++ to edit source code for a very old target system (a PCS) that strictly requires the “OEM-US” character encoding. Some time ago, I created a “User Defined Language” (UDL) for this purpose, and (almost) everything works perfectly. However, I have to manually switch the automatically detected encoding to “OEM-US” every time. It would be great if there were an option in the UDL XML file to specify a particular character encoding so that it is applied automatically when using the UDL.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27633/is-there-a-serious-reason-why-a-user-defined-language-cannot-specify-the-encoding</link><generator>RSS for Node</generator><lastBuildDate>Thu, 17 Sep 2026 03:38:41 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27633.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Aug 2026 17:05:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is there a serious reason why a "user-defined language" cannot specify the encoding? on Sat, 22 Aug 2026 16:22:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a>,<br />
many thanks to Your reply. This workaround works perfectly. I searched for this workaround (because I expected that anyone wouls have the same needs) but wasn’t successful - searching for a solution to a problem can be a frustrating experience if you don’t use the right search term(s) — which, of course, you don’t know yet at that stage…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106168</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106168</guid><dc:creator><![CDATA[SMD40470]]></dc:creator><pubDate>Sat, 22 Aug 2026 16:22:44 GMT</pubDate></item><item><title><![CDATA[Reply to Is there a serious reason why a "user-defined language" cannot specify the encoding? on Wed, 19 Aug 2026 21:29:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/smd40470" aria-label="Profile: SMD40470">@<bdi>SMD40470</bdi></a> ,</p>
<p dir="auto">I think the most likely reason (whether or not you think it’s “serious” enough) is that no one has asked for that feature, and the developer didn’t think of it himself yet.</p>
<p dir="auto">If it was <em>just</em> a UDL issue, I would probably say, “You should put in the feature request, but unfortunately, there have been no new features in UDL for over a decade, with a lot of really good feature requests that would be more fundamental to making UDL work better, so it’s doubtful it would be implemented any time soon.”</p>
<p dir="auto">However, based on <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/18296" rel="nofollow ugc">this Issue about NFO files and OEM-US/CP437 encoding</a>, it looks like there might be other people interested, even in non-UDL circumstances.  So I wonder if the better feature request might be the more generic request, something like <code>[FEATURE REQUEST] Allow setting preferred encoding on a per-language basis</code>.</p>
<p dir="auto">However, there does currently exist a workaround: the AutoCodepage plugin can be used to set default encoding on a per-extension basis.  While it might be nice to have it built in, the plugin currently provides the feature.  Steps to get it to work:</p>
<ul>
<li>Have a UDL.  In my example, I call it <code>MyUDL</code> and I give it the <strong>Ext.:</strong> <code>smd</code>, so all files ending in <code>.smd</code> will be treated as that UDL.  (I picked <code>smd</code> from the letters in your username)</li>
<li>Install the plugin</li>
<li><strong>Plugins &gt; AutoCodepage &gt; Settings</strong>
<ul>
<li>Set <strong>Group Name</strong> = <code>MyUDL</code></li>
<li>Set <strong>Code page to start</strong> = <code>OEM 437: US</code></li>
<li>Leave <strong>Expected language</strong> blank (because that dropdown doesn’t include UDL in the list)</li>
<li>Click the <strong>+</strong> button under the left panel</li>
<li>make sure <code>MyUDL</code> is highlighted in the upper left panel of the dialog</li>
<li>Set <strong>New filename extension(s)</strong> = <code>SMD</code>
<ul>
<li>whether you type in lowercase or uppercase, it ends up uppercase</li>
<li>the plugin automatically adds the <code>.</code> prefix when you <strong>+</strong> the extension</li>
<li>you could type another extension and <strong>+</strong> add it if your UDL has multiple possible extensions</li>
</ul>
</li>
<li>Click the <strong>+</strong> button under the right panel</li>
<li>The dialog should look like:<br />
<img src="/assets/uploads/files/1787174274647-5713f8fa-39a7-4597-b1bf-dc5da4e15e3b-image.jpeg" alt="5713f8fa-39a7-4597-b1bf-dc5da4e15e3b-image.jpeg" class=" img-fluid img-markdown" /></li>
<li><strong>Close</strong> the dialog</li>
<li><strong>side notes:</strong>
<ul>
<li><em>It took me a few times to figure out the right sequence, because the plugin’s documentation is a bit sparse, which is why I was explicit as to the right order.</em></li>
<li><em>If you want to add another group – like an <code>MS-DOS NFO</code> group with the same codepage, but defaulting to the <code>NFO</code> language – you would have to follow similar steps of typing the name, setting the encoding and language, then doing the <strong>+</strong> – even though it looks like you are editing the MyUDL, as soon as you click <strong>+</strong> instead of <strong>Modify</strong>, it will create the new entry instead of modifying the old entry; you then make sure the new entry is selected, and add <code>NFO</code> to its extension list.</em></li>
</ul>
</li>
</ul>
</li>
<li>Create a new file, and immediate right-click the tab and name it <code>blah.smd</code>
<ul>
<li>Notepad++ will automatically apply the UDL, since the UDL extension is set to <code>smd</code></li>
<li>AutoCodepage will automatically apply the OEM-US encoding</li>
</ul>
</li>
<li>Open an existing <code>blah.smd</code> file
<ul>
<li>Notepad++ will automatically apply the UDL, since the UDL extension is set to <code>smd</code></li>
<li>AutoCodepage will automatically apply the OEM-US encoding</li>
</ul>
</li>
</ul>
<p dir="auto">The nice thing about this plugin is that it applies that encoding when you first name, or save-and-name a file, <em>and</em> when you open the file from disk.</p>
<p dir="auto">I believe this should meet your needs, even if no one ever requests or implements the feature in native Notepad++.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106150</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106150</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 19 Aug 2026 21:29:51 GMT</pubDate></item></channel></rss>