<?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[Find BOMs]]></title><description><![CDATA[<p dir="auto">Hello:<br />
Is it possible to use Find in Files to find which files in a folder have the Byte Order Marker in them? I have two test files in a folder–both are UTF-8 encoded, one has the BOM and the other doesn’t. I tried using the regex \xEF\xBB\xBF in the Find What box, but the search returned no results.</p>
<p dir="auto">Am I doing something wrong? Is it not possible? Is there another way to find BOMs?</p>
<p dir="auto">Thanks,<br />
Brig</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/17244/find-boms</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 01:45:21 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/17244.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Mar 2019 17:09:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find BOMs on Thu, 07 Mar 2019 02:19:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">it’s my real name.<br />
unfortunately our family has generations of such strange names.<br />
my brothers for example are called pikachuh and raichuh.</p>
<p dir="auto">here’s a family picture of us:</p>
<p dir="auto"><img src="https://camo.nodebb.org/86aff1b6a848a464d434407f3f444d7be4089955?url=https%3A%2F%2Fi.imgur.com%2F8ikKuy4.jpg" alt="Imgur" class=" img-fluid img-markdown" /></p>
<p dir="auto">😄</p>
<p dir="auto">seriously: i got meta as a nick name ages ago, as when i was little, i started to use anything for everything, beyond of what specific items were originally intended, or designed to be used for … and through the years, more and more of doing that actually started to work out, without anybody (including me) understanding why. 😉</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40772</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40772</guid><dc:creator><![CDATA[Meta Chuh]]></dc:creator><pubDate>Thu, 07 Mar 2019 02:19:20 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 21:42:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/9520">@Meta-Chuh</a></p>
<p dir="auto">LOL</p>
<p dir="auto">Okay, that has me thinking…what does your username actually mean?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40771</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40771</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 06 Mar 2019 21:42:17 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 21:39:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<blockquote>
<p dir="auto">…we’re back to what I postulated in the beginning: meta!</p>
</blockquote>
<p dir="auto">yes … you were calling ? ;-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40770</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40770</guid><dc:creator><![CDATA[Meta Chuh]]></dc:creator><pubDate>Wed, 06 Mar 2019 21:39:43 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 21:34:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> said:</p>
<blockquote>
<p dir="auto">and found that no, the BOM is not in the scintilla buffer</p>
</blockquote>
<p dir="auto">…we’re back to what I postulated in the beginning:  meta!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40769</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40769</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 06 Mar 2019 21:34:37 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 21:23:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said:</p>
<blockquote>
<p dir="auto">Here’s a Pythonscript that does what I mentioned, operating on all files currently open within Notepad++.</p>
</blockquote>
<p dir="auto">Thanks for that framework.  My thought process was that I wanted to see whether the scintilla buffer contained the BOM or whether it was filtered out before then.  With this framework, I added some scintilla-buffer <code>editor.xxx</code> commands, and found that no, the BOM is not in the scintilla buffer:</p>
<pre><code>firstBufferID = notepad.getCurrentBufferID()
for (filename, bufferID, index, view) in notepad.getFiles():
    inf = open(filename, 'rb')
    data_at_start_of_file = inf.read(3)
    inf.close()
    if len(data_at_start_of_file) &gt;= 3 and ord(data_at_start_of_file[0]) == 0xEF and ord(data_at_start_of_file[1]) == 0xBB and ord(data_at_start_of_file[2]) == 0xBF:
        console.write(filename+': found utf-8 bom'+'\n')
    elif len(data_at_start_of_file) &gt;= 2 and ord(data_at_start_of_file[0]) == 0xFE and ord(data_at_start_of_file[1]) == 0xFF:
        console.write(filename+': found ucs-2 big endian bom'+'\n')
    elif len(data_at_start_of_file) &gt;= 2 and ord(data_at_start_of_file[0]) == 0xFF and ord(data_at_start_of_file[1]) == 0xFE:
        console.write(filename+': found ucs-2 little endian bom'+'\n')

    # addendum:
    notepad.activateBufferID( bufferID )
    str = editor.getText()
    console.write('buffer: length = {}\n'.format(len(str)))
    for i in range(3):
        console.write('\t#{}: {} =&gt; {}\n'.format(i, str[i], ord(str[i])))

notepad.activateBufferID( firstBufferID )
</code></pre>
<p dir="auto">Which results in:</p>
<pre><code>C:\Users\peter.jones\...\Peter's Scratchpad.md: found ucs-2 little endian bom
buffer: length = 10861
    #0: ~ =&gt; 126
    #1: ~ =&gt; 126
    #2: ~ =&gt; 126
C:\usr\local\apps\notepad++\plugins\Config\PythonScript\scripts\NppForumPythonScripts\17244-utf-bom-reader.py: found utf-8 bom
buffer: length = 1513
    #0: # =&gt; 35
    #1:   =&gt; 32
    #2: e =&gt; 101
</code></pre>
<p dir="auto">(And no, normally my scratchpad is in UTF8-BOM, not in UCS-2 LE BOM; I just changed it’s encoding temporarily to test out the other BOM-detections.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40768</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40768</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 06 Mar 2019 21:23:41 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 21:07:16 GMT]]></title><description><![CDATA[<p dir="auto">Hello, @brigham_narins, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/9520">@meta-chuh</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a> and <strong>All</strong>,</p>
<p dir="auto">To <strong>simply</strong> answer your question, I would say that, among all files created from within N++, the files having a <strong><code>BOM</code></strong> ( a <strong>Byte Order Mark</strong> ) are :</p>
<ul>
<li>
<p dir="auto">The files with <strong><code>UTF8-BOM</code></strong> encoding, which have a <strong><code>3</code></strong> bytes invisible <strong>BOM</strong> ( <strong><code>EF BB BF</code></strong> )</p>
</li>
<li>
<p dir="auto">The files with <strong><code>UCS-2 BE BOM</code></strong> encoding, which have a <strong><code>2</code></strong> bytes invisible <strong>BOM</strong> ( <strong><code>FE FF</code></strong> )</p>
</li>
<li>
<p dir="auto">The files with <strong><code>UCS-2 LE BOM</code></strong> encoding, which have a <strong><code>2</code></strong> bytes invisible <strong>BOM</strong> ( <strong><code>FF FE</code></strong> )</p>
</li>
</ul>
<p dir="auto">In <strong>all</strong> the other encodings, <strong><code>BOM</code></strong> does <strong>not</strong> exist !</p>
<hr />
<p dir="auto">Here is an other way to verify the <strong>presence</strong> of a <strong><code>BOM</code></strong> :</p>
<ul>
<li>
<p dir="auto">Click on the <strong><code>View &gt; Summary...</code></strong> menu option</p>
</li>
<li>
<p dir="auto">Calculate the <strong>difference</strong>  <strong><code>File length (in byte)</code></strong> <strong>-</strong> <strong><code>Current document length</code></strong> !</p>
</li>
</ul>
<p dir="auto">You’ve just got the <strong><code>BOM</code></strong> <strong>length</strong>, which should be <strong><code>2</code></strong> or <strong><code>3</code></strong> bytes, depending on the file <strong>encoding</strong></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40767</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40767</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 06 Mar 2019 21:07:16 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 20:51:01 GMT]]></title><description><![CDATA[<p dir="auto">I’m waiting for a Python program to do its work, so I started playing.  Here’s a Pythonscript that does what I mentioned, operating on all files currently open within Notepad++. It seemed to work for the little bit of testing I did with it.</p>
<pre><code>for (filename, bufferID, index, view) in notepad.getFiles():
    inf = open(filename, 'rb')
    data_at_start_of_file = inf.read(3)
    inf.close()
    if len(data_at_start_of_file) &gt;= 3 and ord(data_at_start_of_file[0]) == 0xEF and ord(data_at_start_of_file[1]) == 0xBB and ord(data_at_start_of_file[2]) == 0xBF:
        print(filename, ': found utf-8 bom')
    elif len(data_at_start_of_file) &gt;= 2 and ord(data_at_start_of_file[0]) == 0xFE and ord(data_at_start_of_file[1]) == 0xFF:
        print(filename, ': found ucs-2 big endian bom')
    elif len(data_at_start_of_file) &gt;= 2 and ord(data_at_start_of_file[0]) == 0xFF and ord(data_at_start_of_file[1]) == 0xFE:
        print(filename, ': found ucs-2 little endian bom')
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/40766</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40766</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 06 Mar 2019 20:51:01 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 20:22:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/12193">@Brigham-Narins</a> said:</p>
<blockquote>
<p dir="auto">I’d like to come up with a solution inside Notepad++</p>
</blockquote>
<p dir="auto">I understand why you’d want this.  My earlier comment was intended to mean that I believe the BOM stuff is “consumed” when a file is opened, and thus isn’t “obtainable” later.  I haven’t done any investigation, so could be totally wrong about this…</p>
<p dir="auto">By “inside Notepad++”, I’m sure you could write a Pythonscript that could open files in binary and detect BOM.  That may or may not qualify as “inside Notepad++” and of course might be more effort than you were hoping to put in…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40765</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40765</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 06 Mar 2019 20:22:27 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 20:17:12 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/9520"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/9520">@Meta-Chuh</a></a>. And thanks <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a>. I really appreciate your interest in this.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/9520"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/9520">@Meta-Chuh</a></a> said:</p>
<blockquote>
<p dir="auto">i only found some ps, batch, python scripts that list all bom files externally, but you have probably seen them as well (stackoverflow)</p>
</blockquote>
<p dir="auto">I did see those, yes. Ideally I’d like to come up with a solution inside Notepad++, because these outside scripts and such seem to call for expertise and programs I don’t have.</p>
<blockquote>
<p dir="auto">ps: if you are faster in implementing something like this, please share it.<br />
it would be an enrichment.</p>
</blockquote>
<p dir="auto">I’ll do my best and keep you posted, but I came to you for enrichment and enlightenment! :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40764</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40764</guid><dc:creator><![CDATA[Brigham Narins]]></dc:creator><pubDate>Wed, 06 Mar 2019 20:17:12 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 18:36:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">i am bom, i am bom ;-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40744</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40744</guid><dc:creator><![CDATA[Meta Chuh]]></dc:creator><pubDate>Wed, 06 Mar 2019 18:36:48 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 18:26:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/9520">@Meta-Chuh</a> said:</p>
<blockquote>
<p dir="auto">apparently any notepad++ search will only begin after the bom</p>
</blockquote>
<p dir="auto">And this seems right as BOM is meta</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40740</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40740</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 06 Mar 2019 18:26:36 GMT</pubDate></item><item><title><![CDATA[Reply to Find BOMs on Wed, 06 Mar 2019 18:25:06 GMT]]></title><description><![CDATA[<p dir="auto">hi <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/12193">@Brigham-Narins</a><br />
this is a very good and intriguing question. 👍</p>
<blockquote>
<p dir="auto">Am I doing something wrong?</p>
</blockquote>
<p dir="auto">no, you are doing everything correctly.</p>
<p dir="auto">apparently any notepad++ search will only begin after the bom.<br />
this applies to any search mode, regardless if it is a normal search within the current document, or a find in files search.</p>
<p dir="auto">for now i did not find any possibility to find e.g. ef bb bf (utf-8-bom) with the built in functions.<br />
i only found some ps, batch, python scripts that list all bom files externally, but you have probably seen them as well (stackoverflow)</p>
<p dir="auto">i think i/we need some more time to figure out something simple.<br />
(e.g. a custom batch script at the run menu, that searches all files at the path of the current active document. or a python script if you have this plugin installed)</p>
<p dir="auto">ps: if you are faster in implementing something like this, please share it.<br />
it would be an enrichment.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/40738</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/40738</guid><dc:creator><![CDATA[Meta Chuh]]></dc:creator><pubDate>Wed, 06 Mar 2019 18:25:06 GMT</pubDate></item></channel></rss>