<?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[Microsoft "Quotes"]]></title><description><![CDATA[<p dir="auto">Occasionlly I find Microsoft quotes inside my Javascript, but it’s not always easy to spot them with the tiny fonts in use these days. I’m using NPP v7.8.6 on Win 7.  How can I ban Microsoft quotes from appearing in Notepad++?  NPP requires me to use Gmail or FB to post here, so I’m not sure I’ll be able to spot the replies.  Please reply anyway and I’ll keep trying to login to catch any replies.  Thanks!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22264/microsoft-quotes</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Nov 2026 08:42:50 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22264.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 14 Dec 2021 06:35:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Microsoft "Quotes" on Thu, 16 Jan 2025 22:44:21 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> many thanks for this useful regex code!</p>
<p dir="auto">For those who wish to put it into a <a href="https://npp-user-manual.org/docs/config-files/#macros" rel="nofollow ugc">Macro</a> for more convenient usage, you can use the code block below as a template.   Note that the default shortcut sequence is <code>Ctrl</code>+<code>'</code> on US standard keyboards.</p>
<pre><code>&lt;Macro name="Convert smart quotes to code quotes" Ctrl="yes" Alt="no" Shift="no" Key="222"&gt;
	&lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
	&lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="([“”])|[‘’]" /&gt;
	&lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
	&lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="?1&amp;quot;:&amp;apos;" /&gt;
	&lt;Action type="3" message="1702" wParam="0" lParam="768" sParam="" /&gt;
	&lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;
&lt;/Macro&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/99204</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/99204</guid><dc:creator><![CDATA[mathlete2]]></dc:creator><pubDate>Thu, 16 Jan 2025 22:44:21 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft "Quotes" on Wed, 15 Dec 2021 23:59:38 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/james-burke-0" aria-label="Profile: james-burke-0">@<bdi>james-burke-0</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto"><strong>Peter</strong>, why don’t you use, simply, one of these regex S/R :</p>
<p dir="auto">SEARCH <strong><code>([“”])|[‘’]</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1":'</code></strong></p>
<p dir="auto">or</p>
<p dir="auto">SEARCH <strong><code>[“”]|([‘’])</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1':"</code></strong></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72134</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72134</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 15 Dec 2021 23:59:38 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft "Quotes" on Wed, 15 Dec 2021 14:22:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-burke-0" aria-label="Profile: james-burke-0">@<bdi>james-burke-0</bdi></a> said…</p>
<blockquote>
<p dir="auto">Occasionlly I find Microsoft quotes inside my Javascript,</p>
</blockquote>
<p dir="auto">Where are these special quotes coming from?  I would guess they occur when you copy and paste data from other places.</p>
<blockquote>
<p dir="auto">I’m wondering if NPP can block the MS (smart) quotes</p>
</blockquote>
<p dir="auto">Well, not natively, meaning not with Notepad++ as it ships, but you can do a lot with scripting (via the use of a scripting plugin).</p>
<p dir="auto">But even with a scripting plugin, there isn’t really one “blanket” great way to do it.</p>
<p dir="auto">If it were me doing it for my own purpose, I would set it up one of two ways, both using the PythonScript plugin:</p>
<ul>
<li>
<p dir="auto">(Since I presume it is coming a paste,) I would change the paste operation such that the conversion happens before the data is pasted</p>
</li>
<li>
<p dir="auto">I would set it up to do the conversion each time the file is saved</p>
</li>
</ul>
<p dir="auto">Since maybe the “on save” portion is slightly more desirable, and slightly easier to implement, I’ll show that.  If there’s interest in the first method, I could also demo that, but I won’t unless it is asked for.</p>
<p dir="auto">Let’s steal some existing code as a starting point.  I found <a href="https://community.notepad-plus-plus.org/topic/16347/bad-bracket-highlighter">THIS THREAD</a> which has <a href="https://community.notepad-plus-plus.org/post/35089">THIS POSTING - Sep 25, 2018 3:45 PM</a> in it, and I derived the new script’s functionality from that.</p>
<p dir="auto">I call this script <code>QuotesConversionOnSave.py</code> and here it is:</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-

from Npp import *

class QCOS(object):

    def __init__(self):
        notepad.callback(self.beforesave_notify, [NOTIFICATION.FILEBEFORESAVE])

    def beforesave_notify(self, args):
        view_and_index_tuple = (notepad.getCurrentView(), notepad.getCurrentDocIndex(notepad.getCurrentView()))
        notepad.activateBufferID(args['bufferID'])
        if notepad.getCurrentFilename().lower().endswith('.java'):
            editor.rereplace('([“”])?([‘’])?', '(?1")' + "(?2')")
        notepad.activateIndex(*view_and_index_tuple)

if __name__ == '__main__':
    try:
        qcos
    except NameError:
        qcos = QCOS()

</code></pre>
<p dir="auto">How does the script function?  Well, every time an unsaved document is saved, it will see if a file is a <code>.java</code> file, and if so, run Peter’s regular expression replacement on it first before saving.  The other code is there in the event of a <em>Save All</em> to keep the tab active at the time of the save the active tab after the save completes – otherwise you could get a tab switch to a tab different from the one you were working in.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72125</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72125</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 15 Dec 2021 14:22:11 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft "Quotes" on Wed, 15 Dec 2021 13:54:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-burke-0" aria-label="Profile: james-burke-0">@<bdi>james-burke-0</bdi></a> said in <a href="/post/72113">Microsoft "Quotes"</a>:</p>
<blockquote>
<p dir="auto">I’m wondering if NPP can block the MS (smart) quotes</p>
</blockquote>
<p dir="auto">No.  Notepad++ will assume every byte in a file is a character (or part of a character, for multibyte encodings like UTF-8), and will treat it as such.  It is a text editor, and those quote characters are valid text, even if you don’t like them.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72121</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72121</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 15 Dec 2021 13:54:07 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft "Quotes" on Wed, 15 Dec 2021 08:22:12 GMT]]></title><description><![CDATA[<p dir="auto">Peter, thanks - that’s exactly the nuisance that appears from time to time.  I’m wondering if NPP can block the MS (smart) quotes so I don’t have to dig them out from time to time either by hand or using the reg-ex method as per your example.  I can’t find even a simple search method in NPP, nor an encoding choice that will do the job.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72113</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72113</guid><dc:creator><![CDATA[James Burke 0]]></dc:creator><pubDate>Wed, 15 Dec 2021 08:22:12 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft "Quotes" on Tue, 14 Dec 2021 14:04:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-burke-0" aria-label="Profile: james-burke-0">@<bdi>james-burke-0</bdi></a> ,</p>
<p dir="auto">I am going to assume by “Microsoft Quotes”, you mean “Smart Quotes”, like what show up in the forum when you type “quotes” in your text: “”, and ‘smart single quotes’ like here: ‘’</p>
<p dir="auto">If I have a file that has</p>
<pre><code>“Microsoft Quotes”
“Microsoft Quotes”
“Microsoft Quotes”
“”
‘smart single quotes’
‘smart single quotes’
‘smart single quotes’
‘’
</code></pre>
<ul>
<li>FIND = <code>([“”])?([‘’])?</code></li>
<li>REPLACE = <code>(?1")(?2')</code></li>
<li>SEARCH MODE = Regular Expression<br />
and replace them all, I get</li>
</ul>
<pre><code>"Microsoft Quotes"
"Microsoft Quotes"
"Microsoft Quotes"
""
'smart single quotes'
'smart single quotes'
'smart single quotes'
''
</code></pre>
<p dir="auto">which is all normal quotes now instead of “smart quotes”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72101</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72101</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 14 Dec 2021 14:04:48 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft "Quotes" on Tue, 14 Dec 2021 13:18:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-burke-0" aria-label="Profile: james-burke-0">@<bdi>james-burke-0</bdi></a> said in <a href="/post/72093">Microsoft "Quotes"</a>:</p>
<blockquote>
<p dir="auto">Microsoft quotes</p>
</blockquote>
<p dir="auto">I guess a good place to start is to define what <em>Microsoft quotes</em> are.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72098</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72098</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 14 Dec 2021 13:18:20 GMT</pubDate></item></channel></rss>