<?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[Encoding a text file]]></title><description><![CDATA[<p dir="auto">Notepad++ v7.3.3 (32-bit) for windows do not save the new character set of a simple text file, after I translate the whole text with the function »encoding«. Example: Convert any simple text file from ANSI to OEM 852 and save this file. No changes saved! Is that a temporary feature or maybe an unknown error? A little bit strange …</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/13712/encoding-a-text-file</link><generator>RSS for Node</generator><lastBuildDate>Fri, 16 Oct 2026 11:37:29 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/13712.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 23 Apr 2017 21:34:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Encoding a text file on Fri, 19 May 2017 22:19:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/soeren2017" aria-label="Profile: Soeren2017">@<bdi>Soeren2017</bdi></a></p>
<p dir="auto">if I’m allowed - the problem is that these “ansi code pages” do treat the underlying<br />
data (numbers) the same. Means, each code page assigns always a 8bit value to a glyph.<br />
So there is no way for npp to findout if the value it reads, e.g.  0xFC (252),<br />
should be treaten as ü (CP1252) or as exponent three (CP850).</p>
<p dir="auto">I guess it could be said that the different “ansi code pages”  are just a different view<br />
to the same underlying data and as long as there is no info in the file itself which<br />
encoding/code page has been used, to create the file, you have to know it<br />
or in npps view, it tries to guess it.</p>
<p dir="auto">Makes this sense to you?</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/24483</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/24483</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 19 May 2017 22:19:52 GMT</pubDate></item><item><title><![CDATA[Reply to Encoding a text file on Fri, 19 May 2017 21:30:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> Thank you for your detailed explanation. It was very great! But one question is still blurry for me. Why does Notepad++ not save the encoded file? I can encode any plain text file into any code page of the world for temporary watching, but obviously I can’t save the encoded file. Why? Where is the problem? I think this is an error of this nice app, isn’t it?</p>
<p dir="auto">The other guys: Thank you for your response!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/24481</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/24481</guid><dc:creator><![CDATA[Soeren2017]]></dc:creator><pubDate>Fri, 19 May 2017 21:30:07 GMT</pubDate></item><item><title><![CDATA[Reply to Encoding a text file on Sun, 14 May 2017 22:01:46 GMT]]></title><description><![CDATA[<p dir="auto">Hi <strong>All</strong>,</p>
<p dir="auto">I found an <strong>second</strong> solution for outputting <strong>Console</strong> text, with an <strong>Unicode</strong> encoding !</p>
<p dir="auto">Once a window <strong>console</strong> opened, simply execute the <strong>command</strong> <strong><code>chcp 65001</code></strong>. From now on, until you close that <strong>CMD</strong> instance, the <strong>outputs</strong> will use the Unicode <strong><code>UTF-8</code></strong> encoding :-))</p>
<p dir="auto">Refer to the <strong>complete</strong> Microsoft table of <strong>Code Page Identifiers</strong>, below :</p>
<p dir="auto"><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx" rel="nofollow ugc">https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx</a></p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/24255</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/24255</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 14 May 2017 22:01:46 GMT</pubDate></item><item><title><![CDATA[Reply to Encoding a text file on Sun, 14 May 2017 20:47:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/soeren2017" aria-label="Profile: Soeren2017">@<bdi>Soeren2017</bdi></a></p>
<p dir="auto">Perhaps it is worth pointing out that unlike say .DOC files,text files use a very primitive format, in which almost every byte corresponds to a character on the screen. Other than the first two bytes (the BOM) that is sometimes used to indicate UTF8 or UNICODE, there just isn’t anywhere in a text file to stuff extra (invisible) information!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/24252</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/24252</guid><dc:creator><![CDATA[David Bailey]]></dc:creator><pubDate>Sun, 14 May 2017 20:47:06 GMT</pubDate></item><item><title><![CDATA[Reply to Encoding a text file on Sun, 14 May 2017 16:58:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a></p>
<blockquote>
<p dir="auto">despite the fact that my Autodetect character encoding, option, …, is not set!</p>
</blockquote>
<p dir="auto">Seems that our “beloved editor” ;-) is even better than we thought. Maybe the zero byte contained in each code number triggers the automatic decoding as UCS-2 LE.</p>
<p dir="auto">Concerning my plugin: Only a few people <strong>really</strong> need it, it’s the moribund species of batch scripters.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/24248</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/24248</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Sun, 14 May 2017 16:58:01 GMT</pubDate></item><item><title><![CDATA[Reply to Encoding a text file on Sun, 14 May 2017 21:29:01 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a>,</p>
<p dir="auto">Very interesting and <strong>clear</strong> post, about <strong>encodings</strong> ;-))</p>
<p dir="auto">BTW, I did know the <strong><code>chcp</code></strong> DOS command to change the <strong>console</strong> encoding, but was not aware of the possibility to have an <strong>CMD</strong> instance, which outputs results, in <strong>Unicode</strong> ( <strong><code>UCS-2 Little Endian</code></strong> )</p>
<p dir="auto">So, I did a <strong>test</strong> : after opening a Windows <strong>console</strong>, I type the command <strong><code>cmd /u</code></strong> to open a <strong>second</strong> instance and I just type the simple command <strong><code>dir &gt; My installation folder of N++\Test.txt</code></strong>. Then I typed, <strong>twice</strong>, on the <strong><code>exit</code></strong> command and opened my <strong>beloved</strong> editor.</p>
<p dir="auto">And, I can confirm that my <strong>Test.txt</strong> file is, <strong>automatically</strong>, encoded with the <strong><code>UCS-2 Little Endian</code></strong> encoding ( after a glance at the <strong>status</strong> bar ), despite it does <strong>not</strong> have, as you said, any <strong>Byte Order Mark</strong> ( <strong><code>BOM</code></strong> ), and despite the fact that my <strong><code>Autodetect character encoding</code></strong>, option, in <strong>Setting &gt; Preferences… &gt; MISC</strong>, is <strong>not</strong> set !</p>
<p dir="auto"><strong>Remark</strong> : Rather <strong>funny</strong> to notice that <strong>NO</strong> encoding seems attributed to this file, when you just click on the <strong>Encoding</strong> menu ! But, it’s quite <strong>logical</strong>, because its encoding is <strong>not</strong> the true <strong><code>UCS-2 Little Endian BOM</code></strong> encoding.</p>
<p dir="auto">So, to get a true <strong>Unicode</strong> file, with an <strong>invisible BOM</strong> ( The <strong>two</strong> invisible bytes <strong><code>FF FE</code></strong> ) , just use the <strong><code>Encoding &gt; Convert to UCS-2 LE BOM</code></strong> option. This time, you should see, in the <strong>status</strong> bar, the indication <strong><code>UCS-2 LE BOM</code></strong> !  ( You may, either, use the <strong>UTF-8</strong> encoding, with the <strong><code>Encoding &gt; Convert to UTF-8 BOM</code></strong> option ).</p>
<hr />
<p dir="auto">Although I don’t have many <strong>encoding</strong> problems, I’ll have a look to your <strong>AutoCodePage</strong> plugin, soon ! Combined with a <strong>specific</strong> file <strong>extension</strong>, it could be <strong>useful</strong> to some of us ;-))</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/24247</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/24247</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 14 May 2017 21:29:01 GMT</pubDate></item><item><title><![CDATA[Reply to Encoding a text file on Sun, 14 May 2017 12:20:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/soeren2017" aria-label="Profile: Soeren2017">@<bdi>Soeren2017</bdi></a></p>
<p dir="auto">At first I will try to give you an overview of some basics regarding code pages and character encoding. At a glance: It’s all about numbers.</p>
<p dir="auto">After that I will provide some possible solutions for your problem.</p>
<p dir="auto">When you create a plain text file on your hard disk the program you use for this writes NUMBERS to the file. These numbers are codes for the actual characters.  When the file is loaded to display its content the software used for this uses an internal table to map the code numbers to characters.</p>
<p dir="auto">You can imagine that there is an infinite number of possible mappings of code numbers to actual characters. For that reason over the past decades various standardized encoding schemes have been introduced to fit the challenges of a growing number of characters to encode (e.g. special characters in european languages and cyrillic and east asian character sets). These encoding schemes are called “code pages”.</p>
<p dir="auto">Every software dealing with plain text processing uses its own default code page to encode characters. In Notepad++ you can configure the default code page under</p>
<p dir="auto">Menu “Settings” -&gt; New Document -&gt; Encoding</p>
<p dir="auto">The default code page of Windows console commands like “dir” depends on the language of the Windows user interface. On german Windows installations the default code page of console commands is called “OEM 850”. That means if the output of the dir command is redirected to a file (like in your case) this file is written with the OEM 850 character encoding.</p>
<p dir="auto">When this file is loaded into Notepad++ its content (code numbers) is mapped to characters using Notepad++'s default code page which seems to be ANSI in your case. That’s the reason why german umlaut characters contained in the output of the dir command are displayed incorrectly. The code numbers for the äöüßÄÖÜ characters are different in ANSI and OEM 850.</p>
<p dir="auto">To solve your problem there are two different approaches:</p>
<ol>
<li>Setting an appropriate character encoding when creating the file.</li>
<li>Using an appropriate code page when displaying the files content.</li>
</ol>
<p dir="auto">In detail you have four options:</p>
<ol>
<li>
<p dir="auto">When you create the directory listing you can start a console with the command<br />
cmd /u<br />
In this case the output of all internal commands (like “dir”) is done using the UNICODE encoding schema, UTF-16 Little Endian to be precise. Files with this encoding can be displayed correctly in text editors with automatic detection of character encoding (like Notepad++) on most Windos installations world wide. Unfortunately the files are not fully standard compliant because they lack the Byte Order Mark (BOM), a sequence of bytes at the beginning of the file to indicate the encoding. This may come into effect e.g on east asian Windows installations.</p>
</li>
<li>
<p dir="auto">Before executing the dir command you can change the output code page via the command<br />
chcp 1252<br />
On a german Windows installation this sets the output code page to the system’s ANSI code page (in countries other than Germany the system’s ANSI code page may be different, i.e. its number is other than 1252). Files written with this encoding are displayed correctly in every text editor on a german Windows installation.</p>
</li>
<li>
<p dir="auto">When displaying the file’s content in Notepad++ you can switch to code page OEM 850. This is done via<br />
Menu “Encoding” -&gt; Character Set -&gt; Western European -&gt; OEM 850<br />
In this case Notepad++ uses the same code page to decode the file’s content as the console dir command used it to create the file and german umlaut characters are displayed correctly.</p>
</li>
<li>
<p dir="auto">When you create the file you can use a special filename extension for the output file, e.g. “mlst”. An example command would be<br />
dir *.mp3 &gt; MusicList.mlst<br />
If you use my <a href="https://sourceforge.net/projects/autocodepage/" rel="nofollow ugc">AutoCodepage</a> plugin you can make Notepad++ to decode all mlst files automatically with codepage OEM 850.</p>
</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/24245</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/24245</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Sun, 14 May 2017 12:20:48 GMT</pubDate></item><item><title><![CDATA[Reply to Encoding a text file on Sat, 13 May 2017 20:05:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-frank" aria-label="Profile: Claudia-Frank">@<bdi>Claudia-Frank</bdi></a></p>
<p dir="auto">Of course some chars. In the German language you need the characters like ä, ö, ü, ß. I have created a music list with the dos command “dir”. In the text file are some different characters, when I open this file with Notepad++. But I think Notpad++ changes the different characters of the file permanent and not temporary in this editor. A function encoding is irrelevant when the user can’t save the file with some different characters.<br />
By the way: Look at the status bar of this app. If you start Notepad++ you’ll see on the right side only the Word “ANSI” although the settings in “new document” are different.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/24231</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/24231</guid><dc:creator><![CDATA[Soeren2017]]></dc:creator><pubDate>Sat, 13 May 2017 20:05:11 GMT</pubDate></item><item><title><![CDATA[Reply to Encoding a text file on Sun, 23 Apr 2017 21:55:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/soeren2017" aria-label="Profile: Soeren2017">@<bdi>Soeren2017</bdi></a></p>
<blockquote>
<p dir="auto">Is that a temporary feature or maybe an unknown error? A little bit strange …</p>
</blockquote>
<p dir="auto">Or maybe a misunderstanding from users point of view.<br />
Why do you think it failed?<br />
You are aware that different encodings share the some chars, aren’t you?<br />
What do you mean by ANSI to OEM852 - what is your system codepage?</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/23809</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/23809</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Sun, 23 Apr 2017 21:55:34 GMT</pubDate></item></channel></rss>