<?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[Problem adding and copy-pasting UTF characters.]]></title><description><![CDATA[<p dir="auto">I am using Notepad++ v6.8.3 on Windows 10. Ouukay, an oldish version… but the answer to my question in this version might still be the same as the answer in the newest version.</p>
<p dir="auto">I have a php file, encoded as UTF-8 (without BOM), where I convert some hand-picked UTF characters in a text string into corresponding HTML entities. The commands look like this, and they function OK:</p>
<pre><code>        $api_data = str_replace('[xF3]', '&amp;oacute;', $api_data);
        $api_data = str_replace('[xD3]', '&amp;Oacute;', $api_data);
</code></pre>
<p dir="auto">What is written above as [xF3], is not actually a sequence of five ASCII characters “[”, “x”, “F”, “3”, “]”. Rather, it is one character (the UTF character “ö”, I assume), which Notepad++ shows to me as a grey square with letters “xF3” inside it.</p>
<p dir="auto">My first problem: I need to expand the code, and add a similar handling for character ø, which would look like this:</p>
<pre><code>        $api_data = str_replace('[xF8]', '&amp;oslash;', $api_data);
</code></pre>
<p dir="auto">But I cannot find a way to create this grey-square character [xF8] in Notepad++. I wrote the original code a year ago, so I must have been able to create those characters back then, but I no longer remember how I did it.</p>
<p dir="auto">If I write the desired ø character in some other program, and copy-paste it into this php file, it appears in the code as the character actually looks like – and the code will not work. This UTF character in input string will not get converted into “ø”.</p>
<p dir="auto">My second problem is that I cannot copy-paste these code lines in Notepad++ into a different part of the code. If I copy the two code lines mentioned at start of this post, and then paste them to a different place in the same php file, what I get with the paste command is not identical with the lines that I copied. Rather, they look like this:</p>
<pre><code>        $api_data = str_replace('󧬠'&amp;oacute;', $api_data);
        $api_data = str_replace('ӧ, '&amp;Oacute;', $api_data);
</code></pre>
<p dir="auto">What happens during the copy-paste process is that “[xF3]‘, " (the grey square character + three basic ASCII characters) becomes "󧬠’” (some strange character + one basic ASCII character), and on the second line "[xD3]', " (the grey square character + three basic ASCII characters) becomes "ӧ, " (one special character [which by chance is LOWERCASE of the uppercase character to encode] + two basic ASCII characters.</p>
<p dir="auto">Below is a broader sample of what weird stuff I get with the Paste command, when the copied code lines had as the firts parameter of str_replace command a grey-square UTF character (in single quotation marks) which corresponds to the html entity code given as second parameter of the command:</p>
<pre><code>        $api_data = str_replace('䧬 '&amp;auml;', $api_data);
        $api_data = str_replace('ħ, '&amp;Auml;', $api_data);
        $api_data = str_replace('��'&amp;ouml;', $api_data);
        $api_data = str_replace('֧, '&amp;Ouml;', $api_data);
        $api_data = str_replace('姬 '&amp;aring;', $api_data);
        $api_data = str_replace('ŧ, '&amp;Aring;', $api_data);
        $api_data = str_replace('��'&amp;uuml;', $api_data);
        $api_data = str_replace('ܧ, '&amp;Uuml;', $api_data);
        $api_data = str_replace('᧬ '&amp;aacute;', $api_data);
        $api_data = str_replace('g, '&amp;Aacute;', $api_data);
        $api_data = str_replace('駬 '&amp;eacute;', $api_data);
        $api_data = str_replace('ɧ, '&amp;Eacute;', $api_data);
        $api_data = str_replace('� '&amp;iacute;', $api_data);
        $api_data = str_replace('ͧ, '&amp;Iacute;', $api_data);
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/12426/problem-adding-and-copy-pasting-utf-characters</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 18:13:13 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/12426.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Sep 2016 11:08:20 GMT</pubDate><ttl>60</ttl></channel></rss>