<?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[Convert multiple files from UTF-8 to ANSI]]></title><description><![CDATA[<p dir="auto">hello, does anybody know how to convert 200 files from UTF-8 to ANSI ?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/12374/convert-multiple-files-from-utf-8-to-ansi</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 03:05:26 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/12374.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Sep 2016 17:15:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Convert multiple files from UTF-8 to ANSI on Sun, 26 Feb 2017 15:06:14 GMT]]></title><description><![CDATA[<p dir="auto">I run this code with python.exe on win10.  I only change the path, and I want to test it. But after I copy the code on  python.exe, nothing happen.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/22168</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/22168</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Sun, 26 Feb 2017 15:06:14 GMT</pubDate></item><item><title><![CDATA[Reply to Convert multiple files from UTF-8 to ANSI on Sun, 26 Feb 2017 14:51:52 GMT]]></title><description><![CDATA[<p dir="auto">hello. How can I run this python codes to all files from a folder?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/22167</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/22167</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Sun, 26 Feb 2017 14:51:52 GMT</pubDate></item><item><title><![CDATA[Reply to Convert multiple files from UTF-8 to ANSI on Sun, 26 Feb 2017 02:53:50 GMT]]></title><description><![CDATA[<p dir="auto">Correction to the second solution :</p>
<pre><code>    nested_levels = root.split('\\')
    if len(nested_levels) == 2:
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/22162</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/22162</guid><dc:creator><![CDATA[Maxim Chartrand]]></dc:creator><pubDate>Sun, 26 Feb 2017 02:53:50 GMT</pubDate></item><item><title><![CDATA[Reply to Convert multiple files from UTF-8 to ANSI on Sat, 25 Feb 2017 01:25:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@Scott-Sumner</a></p>
<p dir="auto">Thank you very much, I will use your solution.</p>
<p dir="auto">I just found another solution here :<br />
<a href="http://stackoverflow.com/questions/17493271/limit-the-number-of-nested-directories-traversed-by-os-walk" rel="nofollow ugc">http://stackoverflow.com/questions/17493271/limit-the-number-of-nested-directories-traversed-by-os-walk</a></p>
<p dir="auto">Here is my code, maybe it will helps someone else with a different need.</p>
<pre><code>import os;
import sys;
Path="C:\\python-test"
for root, dirs, files in os.walk(Path):
	nested_levels = root.split('/')
	if len(nested_levels) &gt; 0:
		del dirs[:]
	for filename in files:		
		if filename[-5:] == '.html':
			notepad.open(root + "\\" + filename)
			console.write(root + "\\" + filename + "\r\n")
			notepad.runMenuCommand("Encodage", "Convertir en UTF-8")
			notepad.save()
			notepad.close()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/22135</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/22135</guid><dc:creator><![CDATA[Maxim Chartrand]]></dc:creator><pubDate>Sat, 25 Feb 2017 01:25:40 GMT</pubDate></item><item><title><![CDATA[Reply to Convert multiple files from UTF-8 to ANSI on Sat, 25 Feb 2017 00:42:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7839">@Maxim-Chartrand</a></p>
<p dir="auto">Perhaps the quickest way to modify it to do what you want would be adding a single line below the os.walk() line:</p>
<pre><code>for root, dirs, files in os.walk(Path):
    if root == Path:
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/22133</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/22133</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 25 Feb 2017 00:42:46 GMT</pubDate></item><item><title><![CDATA[Reply to Convert multiple files from UTF-8 to ANSI on Sat, 25 Feb 2017 00:05:34 GMT]]></title><description><![CDATA[<p dir="auto">Here is the script :</p>
<pre><code>import os;
import sys;
Path="C:\\python-test"
for root, dirs, files in os.walk(Path):
	for filename in files:		
		if filename[-5:] == '.html':
			notepad.open(root + "\\" + filename)
			console.write(root + "\\" + filename + "\r\n")
			notepad.runMenuCommand("Encodage", "Convertir en ANSI")
			notepad.save()
			notepad.close()
</code></pre>
<p dir="auto">Results:<br />
(I want to exclude : files in subdirectories below python-test folder)</p>
<pre><code>C:\python-test\fichier1.html
C:\python-test\fichier2.html
C:\python-test\python-folder\fichier3.html
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/22132</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/22132</guid><dc:creator><![CDATA[Maxim Chartrand]]></dc:creator><pubDate>Sat, 25 Feb 2017 00:05:34 GMT</pubDate></item><item><title><![CDATA[Reply to Convert multiple files from UTF-8 to ANSI on Fri, 24 Feb 2017 23:38:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I was looking for a way to do it in NPP. I found a solution with a Python script (see below) but I’m looking for a way to limit the depth of os.walk method. I want to apply the conversion to HTML files located in the first level only, excluding those in subdirectories. Can someone help on this? Thanks.</p>
<p dir="auto"><a href="https://pw999.wordpress.com/2013/08/19/mass-convert-a-project-to-utf-8-using-notepad/" rel="nofollow ugc">https://pw999.wordpress.com/2013/08/19/mass-convert-a-project-to-utf-8-using-notepad/</a></p>
<p dir="auto">Maxim</p>
]]></description><link>https://community.notepad-plus-plus.org/post/22130</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/22130</guid><dc:creator><![CDATA[Maxim Chartrand]]></dc:creator><pubDate>Fri, 24 Feb 2017 23:38:26 GMT</pubDate></item><item><title><![CDATA[Reply to Convert multiple files from UTF-8 to ANSI on Wed, 21 Sep 2016 03:16:46 GMT]]></title><description><![CDATA[<p dir="auto">there is a nice and useful program, name “Cp Converter” (Codepage Converter) the same thing.  This will do all the encoding converts for multiple files.</p>
<p dir="auto"><a href="https://sourceforge.net/projects/cp-converter/" rel="nofollow ugc">https://sourceforge.net/projects/cp-converter/</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/17975</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/17975</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Wed, 21 Sep 2016 03:16:46 GMT</pubDate></item></channel></rss>