<?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 any way to convert code points to unicode]]></title><description><![CDATA[<p dir="auto">I have some text like 72\101\108\108\111\32\87\111\114\108\100\33<br />
and i want to convert it to “Hello World!”</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/24298/is-there-any-way-to-convert-code-points-to-unicode</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 23:38:30 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/24298.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Mar 2023 09:54:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Wed, 05 Apr 2023 18:51:19 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> said:</p>
<blockquote>
<p dir="auto">You could create an HTML file that includes your code points as HTML entity numbers</p>
</blockquote>
<p dir="auto">…and…</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a> said:</p>
<blockquote>
<p dir="auto">you can encode the text as numeric entities, then convert them right in Notepad++ with the <em>HTML Tag</em> plugin</p>
</blockquote>
<p dir="auto">…and that’s all fine, but the OP ( <a class="plugin-mentions-user plugin-mentions-a" href="/user/user-000" aria-label="Profile: User-000">@<bdi>User-000</bdi></a> ) had a title on this posting of “Is there any way to convert code points to <em><strong>unicode</strong></em>”, so I found it curious that no example was provided that actually had some fun and uses any “fancy” unicode characters.  (Of course, OP didn’t do this in his sample data, either…).</p>
<p dir="auto">I didn’t try with the <em>HTML Tag</em> plugin, but I did try the “HTML file” approach with some “fancy” character data:</p>
<pre><code>&lt;body&gt;
    &lt;p&gt;
        &amp;#72&amp;#101&amp;#108&amp;#108&amp;#111&amp;#32&amp;#87&amp;#111&amp;#114&amp;#108&amp;#100&amp;#33&amp;#x25BC&amp;#x1F499
    &lt;/p&gt;
&lt;/body&gt;
</code></pre>
<p dir="auto">and indeed it worked just fine to show the fancy-ness for characters U+25BC and U+1F499; here shown in Chrome:</p>
<p dir="auto"><img src="/assets/uploads/files/1680720461672-547dfa37-ee07-4847-ada1-da6b98332cd1-image.png" alt="547dfa37-ee07-4847-ada1-da6b98332cd1-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/85512</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85512</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 05 Apr 2023 18:51:19 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Thu, 30 Mar 2023 05:57:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-wormer" aria-label="Profile: Paul-Wormer">@<bdi>Paul-Wormer</bdi></a></p>
<p dir="auto">I would even go so far as to say that the given example is good for seeing where the problem lies with encodings, since it fits several, it could be ascii, cp1252, utf8… be.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85303</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85303</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 30 Mar 2023 05:57:34 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Wed, 29 Mar 2023 09:56:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-wormer" aria-label="Profile: Paul-Wormer">@<bdi>Paul-Wormer</bdi></a> I believe I have the answer to my own question: in the 2 byte packing, indicated by <code>pack('h', n)</code>, 2 trailing  zeroes are added for numbers below 256. They show up as <code>\x00</code>,  also after <code>decode('cp850')</code>. IMHO, it would probably have been  clearer (also for future use) if Mark Olson had gone  the 2-byte way  consistently and had written <code>decode('utf_16')</code> in his Python snippet instead of <code>decode('cp850')</code>. There also would  have been no need to remove <code>\x00</code> then. The OP asked about 7-bit ASCII anyway and for this all codings are equal.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85282</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85282</guid><dc:creator><![CDATA[Paul Wormer]]></dc:creator><pubDate>Wed, 29 Mar 2023 09:56:59 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Wed, 29 Mar 2023 08:59:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a> Why do you deem it necessary to remove <code>\x00</code>? Where would it come from?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85281</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85281</guid><dc:creator><![CDATA[Paul Wormer]]></dc:creator><pubDate>Wed, 29 Mar 2023 08:59:25 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Tue, 28 Mar 2023 14:24:37 GMT]]></title><description><![CDATA[<p dir="auto">I’d replace <code>struct.pack('B', int(char))</code> with <code>struct.pack('h', int(char))</code> and add a call to <code>out = out.replace('\x00', '')</code> at the end. <code>'h'</code> allows you to handle any number less than 65536, which conveniently includes the entire Basic Multilingual Plane and thus allows you to use <code>'utf-16'</code> as the encoding.</p>
<p dir="auto">Putting it all together:</p>
<pre><code class="language-py">import re
import struct
from Npp import *

ins_pos = editor.getSelectionStart()
selected_text = editor.getSelText()
nums = [int(n) for n in re.findall('\d+', selected_text)]
decoded = [struct.pack('h', n).decode('cp850') for n in nums]
replacement = ''.join(decoded).replace('\x00', '')

editor.insertText(ins_pos, replacement)
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/85273</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85273</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Tue, 28 Mar 2023 14:24:37 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Tue, 28 Mar 2023 07:53:27 GMT]]></title><description><![CDATA[<p dir="auto">Replacing cp850 with <code>mbcs</code>, the configured ANSI code page of the current Windows setup is used.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85267</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85267</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 28 Mar 2023 07:53:27 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Mon, 27 Mar 2023 10:47:08 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> said in <a href="/post/85238">Is there any way to convert code points to unicode</a>:</p>
<blockquote>
<p dir="auto">Results with accentuated characters are weird, although correct ?</p>
</blockquote>
<p dir="auto">The Python function call  <code>chr(n)</code> returns the character with Unicode code point <code>n</code>. The block of Unicode code points 0x80-0x9F  (128-159) is assigned to control characters, not to (accented) letters.  In the   block 0x80-0xFF (128-255) Unicode coincides with   ISO/IEC 8859-1 (aka Latin-1).</p>
<p dir="auto">I introduced, for the fun of it,  the Danish character <code>ø</code> in the <code>Hello wørld!</code>  example above.  In the CP850 encoding (aka extended ASCII) used,  the character <code>ø</code> has code point 155. Hence, this code point correspond in  Latin-1 to a (non-printable) control character.</p>
<p dir="auto">So, when you use the function <code>chr</code> you have to make sure that you stick to Latin-1. I don’t know if this explains the weirdness of your accented characters, but in any case different encodings can cause confusion and are a point of concern.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85246</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85246</guid><dc:creator><![CDATA[Paul Wormer]]></dc:creator><pubDate>Mon, 27 Mar 2023 10:47:08 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Sun, 26 Mar 2023 19:05:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/user-000" aria-label="Profile: user-000">@<bdi>user-000</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-wormer" aria-label="Profile: paul-wormer">@<bdi>paul-wormer</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">From this <a href="https://github.com/iluzioDev/ChaCha20-cipher/blob/main/ChaCha20-cipher.py" rel="nofollow ugc">python 3 file</a>, I was able to <strong>extract</strong> the parts regarding the <strong><code>Text to Ascii</code></strong> and <strong><code>Ascii to Text</code></strong> <strong>conversions</strong> and adapt it as a <strong><code>Python 2.7</code></strong> N++ script, Pheeew !</p>
<p dir="auto">However, my script below is certainly very <strong>weak</strong> as :</p>
<ul>
<li>
<p dir="auto">Results <strong>need</strong> to be read in the Python <strong><code>console</code></strong> <strong>only</strong></p>
</li>
<li>
<p dir="auto">Results with <strong>accentuated</strong> characters are <strong>weird</strong>, although correct ?</p>
</li>
</ul>
<p dir="auto">So, I really need some <strong>insights</strong> from <strong><code>Python</code></strong>’s gurus, in our forum, to <strong>improve</strong> a bit that script !</p>
<pre><code class="language-py"># Converts a String to ASCII Code Integers

def asc(text):
    return ''.join([str(ord(i)).zfill(3) for i in text])

# Converts ASCII Code Integers to a String

def txt(ascii):
    ascii = str(ascii)
    if len(ascii) % 3 != 0:
        ascii = ascii.zfill(len(ascii) + (3 - (len(ascii) % 3)))
    return ''.join(chr(int(ascii[i - 2] + ascii[i - 1] + ascii[i])) for i in range(len(ascii) - 1, 0, -3))[::-1]

# Main Function

def main():

    while True:

        option = notepad.prompt('Enter T for Ascii to Text conversion\nEnter A for Text to Ascii conversion\n','','')

        if option not in ['T', 'A', '']:
            continue

        if option == '':
          break

        if option == 'T':
            answer = notepad.prompt('Enter ASCII values of 3 DECIMAL digits : ','','')
            print(txt(answer))

        if option == 'A':
            answer = notepad.prompt('Enter an ASCII TEXT string: ','','')
            print(asc(answer))

main()
</code></pre>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<ul>
<li>I saw this article, on the <strong>Net</strong>, related to <strong><code>Powershell</code></strong> :</li>
</ul>
<blockquote>
<p dir="auto">In <strong><code>PowerShell 6</code></strong> and <strong>later</strong>, the <strong><code>-replace</code></strong> operator also accepts a <strong>script</strong> block that performs the replacement. The script block runs <strong>once</strong> for <strong>every</strong> match.</p>
</blockquote>
<blockquote>
<p dir="auto"><strong><code>&lt;String&gt; -replace &lt;regular-expression&gt;, {&lt;Script-block&gt;}</code></strong></p>
</blockquote>
<blockquote>
<p dir="auto">Within the script block, use the <strong><code>$_</code></strong> automatic variable to access the input text being replaced and other useful information. This variable’s class type is <strong>System.Text.RegularExpressions.Match</strong>.</p>
</blockquote>
<blockquote>
<p dir="auto">The following example replaces each sequence of <strong>three</strong> digits with the <strong>equivalent</strong> character. The script block runs for each set of three digits that needs to be replaced.</p>
</blockquote>
<blockquote>
<p dir="auto"><strong>Input</strong> :</p>
</blockquote>
<blockquote>
<p dir="auto"><strong><code>"072101108108111" -replace "\d{3}", {return [char][int]$_.Value}</code></strong></p>
</blockquote>
<blockquote>
<p dir="auto"><strong>Output</strong> :</p>
</blockquote>
<blockquote>
<p dir="auto"><strong><code>Hello</code></strong></p>
</blockquote>
<blockquote>
<p dir="auto">To know your <strong>PS version</strong>, open the PS console, type  <strong><code>$PSVersionTable</code></strong> and looks for the <strong>PSVersion</strong> value</p>
</blockquote>
<hr />
<ul>
<li>I also found these <strong>two</strong> <strong><code>JavaScript</code></strong> programs, on <strong><code>Stack Overflow</code></strong> which could be of some interest :</li>
</ul>
<pre><code class="language-js">var StringTools = {
  stringToNumbersArray: function(data){
    return data.split('').map(function(c){return c.charCodeAt(0);});
  },
  numbersArrayToString: function(arr){
    return arr.map(function(n){return String.fromCharCode(n)}).join('');
  }
}

StringTools.stringToNumbersArray("Hello");
// =&gt; [72, 101, 108, 108, 111]

StringTools.numbersArrayToString([72, 101, 108, 108, 111])
// =&gt; "Hello"
</code></pre>
<p dir="auto">And :</p>
<pre><code class="language-js">function convertToNumber(str){
  var number = "";
  for (var i=0; i&lt;str.length; i++){
    charCode = ('000' + str[i].charCodeAt(0)).substr(-3);
    number += charCode;
  }
  return number;
}
alert(convertToNumber("SO does my homework")); //console.log is better


function convertToString(numbers){
  origString = "";
  numbers = numbers.match(/.{3}/g);
  for(var i=0; i &lt; numbers.length; i++){
    origString += String.fromCharCode(numbers[i]);
  }
  return origString;
}
alert(convertToString("083079032100111101115032109121032104111109101119111114107"));  //console.log is better
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/85238</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85238</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 26 Mar 2023 19:05:27 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Sun, 26 Mar 2023 14:32:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user-000" aria-label="Profile: User-000">@<bdi>User-000</bdi></a> If you don’t mind using the PythonScript plugin, then here is a simple script. You select with the mouse the string <code>72\101\...\33</code> and run the script below. It will insert the extended ASCII characters just before the selection.</p>
<pre><code>#72\101\108\108\111\32\87\155\114\108\100\33

import struct           # Python 2
from Npp import *
s = editor.getSelText().split('\\') 
ins_pos = editor.getSelectionStart() 
out = ''
for char in s:
    out+=struct.pack('B', int(char)).decode('cp850')
editor.insertText(ins_pos, out )
</code></pre>
<p dir="auto">The test string in the comment  will become <code>#Hello Wørld!72\101\108\108\111\32\87\155\114\108\100\33</code> after selecting it and running this script.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85237</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85237</guid><dc:creator><![CDATA[Paul Wormer]]></dc:creator><pubDate>Sun, 26 Mar 2023 14:32:18 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Sun, 26 Mar 2023 09:27:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a> Huge thanks that’s what i need</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85231</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85231</guid><dc:creator><![CDATA[User 000]]></dc:creator><pubDate>Sun, 26 Mar 2023 09:27:53 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Sat, 25 Mar 2023 22:06:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user-000" aria-label="Profile: User-000">@<bdi>User-000</bdi></a>,</p>
<blockquote>
<p dir="auto">i want to convert it to “Hello World!”</p>
</blockquote>
<p dir="auto">As suggested above, you can encode the text as numeric entities, then convert them right in Notepad++ with the <a href="https://bitbucket.org/rdipardo/htmltag/downloads" rel="nofollow ugc">HTML Tag plugin</a> (*1):</p>
<p dir="auto"><img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY2ZkYzAyZmQ3ZDM5YzdlMjQ0ZDVhYTNhMWExNDlhN2I5ZDVlMjAxNiZjdD1n/kjMySear4nrSHd3DG3/giphy.gif" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">Your file doesn’t even have to be a recognized markup language (*2):</p>
<p dir="auto"><img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExNTI1NTZmZDhhYTc2NzYyY2U1ZGNkZGU1NjBjNDZhZjZiMDE4YzM3NiZjdD1n/UZNpiOSFF4P1V20TXv/giphy.gif" alt="" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">(*1) In the GIFs I call the “Select tag contents only” <a href="https://github.com/rdipardo/nppHTMLTag#usage" rel="nofollow ugc">command</a>, then "Decode selected (HTML) entities.</p>
<p dir="auto">(*2) Exception: most named entities (e.g. <code>&amp;copy;</code>) are unrecognized by the <a href="https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#List_of_predefined_entities_in_XML" rel="nofollow ugc">XML 1.0 specification</a>; the plugin falls back to <a href="https://bitbucket.org/rdipardo/htmltag/issues/3/unicode-utf-8-numeric-entity-wrong#comment-63730255" rel="nofollow ugc">numeric entities</a> in those cases.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85216</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85216</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Sat, 25 Mar 2023 22:06:15 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Sat, 25 Mar 2023 12:37:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user-000" aria-label="Profile: User-000">@<bdi>User-000</bdi></a></p>
<p dir="auto">You could create an HTML file that includes your code points as HTML entity numbers (i.e. you have to replace <code>\</code> by <code>&amp;#</code> at first). For example:</p>
<pre><code class="language-html">&lt;body&gt;
    &lt;p&gt;
        &amp;#72&amp;#101&amp;#108&amp;#108&amp;#111&amp;#32&amp;#87&amp;#111&amp;#114&amp;#108&amp;#100&amp;#33
    &lt;/p&gt;
&lt;/body&gt;
</code></pre>
<p dir="auto">Opening the resulting file in a web browser makes it possible to copy the plain text.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85201</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85201</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Sat, 25 Mar 2023 12:37:45 GMT</pubDate></item><item><title><![CDATA[Reply to Is there any way to convert code points to unicode on Sat, 25 Mar 2023 10:48:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user-000" aria-label="Profile: User-000">@<bdi>User-000</bdi></a></p>
<p dir="auto">It’s not something that Notepad++ can do for you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/85199</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/85199</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 25 Mar 2023 10:48:20 GMT</pubDate></item></channel></rss>