<?xml version="1.0" encoding="windows-1252"?>
<node id="964602" title="Re^3: UTF8 URI Escaping" created="2012-04-11 14:54:09" updated="2012-04-11 14:54:09">
<type id="11">
note</type>
<author id="888573">
Eliya</author>
<data>
<field name="doctext">
&lt;blockquote&gt;
&lt;i&gt; ... I _still_ get: \xc2\xa3  &lt;/i&gt;
&lt;/blockquote&gt;
&lt;p&gt; How do you tell?&amp;nbsp; Did you print it to somewhere, etc.?&amp;nbsp; What exactly do you finally want to achieve? &lt;/p&gt;
&lt;p&gt; In case the idea is to convert the pound sign to Latin-1 encoding, you'd need to encode the decoded string again: &lt;/p&gt;
&lt;c&gt;
$v = encode('ISO-8859-1', $v);
&lt;/c&gt;
&lt;p&gt; Here's a complete example (note the differences in the PV representations in the 3 dumps): &lt;/p&gt;
&lt;c&gt;
#!/usr/bin/perl -w
use strict;
use Encode;
use Devel::Peek;

my $v= "%C2%A3";

$v =~ s/%([a-fA-F0-9]{2})/pack('C', hex($1))/eg;
Dump $v;

my $decoded = decode("UTF-8", $v);
Dump $decoded;

my $encoded = encode("ISO-8859-1", $decoded);
Dump $encoded;

__END__
SV = PVMG(0xf98470) at 0xf15d08
  REFCNT = 1
  FLAGS = (PADMY,SMG,POK,pPOK)
  IV = 0
  NV = 0
  PV = 0xf46af0 "\302\243"\0
  CUR = 2
  LEN = 8
  MAGIC = 0xf0f350
    MG_VIRTUAL = &amp;PL_vtbl_mglob
    MG_TYPE = PERL_MAGIC_regex_global(g)
    MG_LEN = -1
SV = PV(0xeee388) at 0xf16080
  REFCNT = 1
  FLAGS = (PADMY,POK,pPOK,UTF8)
  PV = 0xfe40c0 "\302\243"\0 [UTF8 "\x{a3}"]
  CUR = 2
  LEN = 8
SV = PV(0xeee448) at 0xf16110
  REFCNT = 1
  FLAGS = (PADMY,POK,pPOK)
  PV = 0xfd44c0 "\243"\0
  CUR = 1
  LEN = 8
&lt;/c&gt;</field>
<field name="root_node">
964503</field>
<field name="parent_node">
964587</field>
</data>
</node>
