<?xml version="1.0" encoding="windows-1252"?>
<node id="964508" title="Re: UTF8 URI Escaping" created="2012-04-11 07:24:53" updated="2012-04-11 07:24:53">
<type id="11">
note</type>
<author id="888573">
Eliya</author>
<data>
<field name="doctext">
&lt;p&gt; The two octet sequence &lt;c&gt;c2 a3&lt;/c&gt; is the [wp://UTF-8] encoding of the pound character, so for Perl to treat it as one single character, you need to &lt;i&gt;decode&lt;/i&gt; it: &lt;/p&gt;
&lt;c&gt;
use Encode;

my $f = "%C2%A3";

$f =~ s/%([a-fA-F0-9]{2})/pack('C', hex($1))/eg;

my $decoded = decode("UTF-8", $f);
&lt;/c&gt;
&lt;p&gt; And then, depending on what you want to do with the decoded string on the output side, you might want to encode it again &amp;#8212; usually done via setting the appropriate [doc://PerlIO] encoding layer for the respective file handle. &lt;/p&gt;</field>
<field name="root_node">
964503</field>
<field name="parent_node">
964503</field>
</data>
</node>
