<div dir="ltr">Hold on. The string you already had, the dump of which you gave us, was already okay, or close enough to it. What happens if you tried just printing it (not with Data::Dumper)?<br><br>I&#39;m asking because I don&#39;t see any UTF-8 specifically, I just see a bunch of code points. The string is &quot;הצגת-מפ&quot;, which you can easily see by looking up some characters in a Unicode table. You didn&#39;t show us any evidence of UTF-8 overencoding; if there was some, we&#39;d be seeing the values 0xd7 0x94 etc. (the UTF-8 encoding of the abstract code point U+05d4).<div>
<br></div><div>I think it&#39;s Dumper that was escaping things because it wasn&#39;t sure your terminal could display them or whatever. Just try &quot;print $buf&quot;.<br><div><div><br><div class="gmail_quote">On Fri, Oct 12, 2012 at 12:40 AM, ynon perek <span dir="ltr">&lt;<a href="mailto:ynonperek@gmail.com" target="_blank">ynonperek@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex"><div dir="ltr">Hi All,<div>Thanks for all the help. </div><div><br></div><div>
Problem was in fact the opposite - double encoding (turned out both lib::XML and Dancer encode to utf-8...)</div><div><br></div><div>I ended up using decode(&#39;utf-8&#39;) on the data before passing it on, and this solved the issue (so now I have encode -&gt; decode -&gt; encode chain... which is why abstractions are evil).</div>

<div><br></div><div>Have a great weekend, </div><span class="HOEnZb"><font color="#888888"><div>  Ynon</div></font></span><div><div class="h5"><div><br><br><div class="gmail_quote">On 11 October 2012 18:49, Meir Guttman <span dir="ltr">&lt;<a href="mailto:meir@guttman.co.il" target="_blank">meir@guttman.co.il</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hey Gaal,<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I would look up Data::Dumper::AutoEncode (<a href="http://search.cpan.org/~bayashi/Data-Dumper-AutoEncode-0.102/lib/Data/Dumper/AutoEncode.pm" target="_blank">http://search.cpan.org/~bayashi/Data-Dumper-AutoEncode-0.102/lib/Data/Dumper/AutoEncode.pm</a>). You can then use ‘eDumper’ rather than Dumper to actually see letters. This package also enables you to use any encoding you want. (The default though in utf8.)<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Meir<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>

<p class="MsoNormal" style="margin-left:36.0pt"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:perl-bounces@perl.org.il" target="_blank">perl-bounces@perl.org.il</a> [mailto:<a href="mailto:perl-bounces@perl.org.il" target="_blank">perl-bounces@perl.org.il</a>] <b>On Behalf Of </b>Gaal Yahas<br>

<b>Sent:</b> </span><span lang="HE" dir="RTL" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">יום ה 11 אוקטובר 2012 17:03</span><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"><br>

<b>To:</b> Perl in Israel<br><b>Subject:</b> Re: [Israel.pm] Encoding Question<u></u><u></u></span></p><div><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p><div><p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:36.0pt">

U+05d4 is HEBREW LETTER HE etc. -- your buffer is already in Unicode.<u></u><u></u></p><div><p class="MsoNormal" style="margin-left:36.0pt">On Thu, Oct 11, 2012 at 4:51 PM, ynon perek &lt;<a href="mailto:ynonperek@gmail.com" target="_blank">ynonperek@gmail.com</a>&gt; wrote:<u></u><u></u></p>

<div><p class="MsoNormal" style="margin-left:36.0pt">Hi All,<u></u><u></u></p><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt">Quick encoding question: I have  a text string that I think is in cp1255, because when I print it with Data::Dumper I get:<u></u><u></u></p>

</div><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt">\x{5d4}\x{5e6}\x{5d2}\x{5ea}-\x{5de}\x{5e4}<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt">

<br clear="all"><u></u><u></u></p><div><p class="MsoNormal" style="margin-left:36.0pt">But, when I try to decode it using:<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div>

<div><p class="MsoNormal" style="margin-left:36.0pt">my $decoded = decode(&#39;CP1255&#39;, $text);<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt">

I get this error:<u></u><u></u></p></div><div><div style="border-top:black;border-left:black;border-bottom:#eeeeee;border-right:#eeeeee;border-style:solid;border-width:1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#333344;margin-left:36.0pt;margin-right:0cm">

<pre style="background:#333344;border:none;padding:0cm"><span style="font-size:9.0pt;font-family:&quot;Lucida Console&quot;;color:#ccccdd"><u></u> <u></u></span></pre><pre style="background:#333344;border:none;padding:0cm">
<span style="font-size:9.0pt;font-family:&quot;Lucida Console&quot;;color:#ccccdd">Wide character in subroutine entry at /Users/ynonperek/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/darwin-2level/Encode.pm line 174, &lt;DATA&gt; line 16.<u></u><u></u></span></pre>

</div></div><div><p class="MsoNormal" style="margin-left:36.0pt">Ideas ?<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-left:36.0pt"><span style="color:#888888"><u></u> <u></u></span></p></div><p class="MsoNormal" style="margin-left:36.0pt">

<span><span style="color:#888888">-- </span></span><u></u><u></u></p></div><div><div><div><p class="MsoNormal" dir="RTL" style="margin-right:36.0pt;text-align:right;direction:rtl"><span lang="AR-SA" style="color:#888888"><br>

</span><span lang="HE" style="color:#888888">כותב הרצאות ? מדבר מול קהל ? הבלוג שלי</span><span lang="HE" style="color:#888888"> </span><span lang="AR-SA" style="color:#888888"><a href="http://publicspeakr.blogspot.com/" target="_blank"><span lang="HE">לומד לדבר</span></a> </span><span lang="HE" style="color:#888888">כתוב במיוחד בשבילך.</span><span dir="LTR" style="color:#888888"><u></u><u></u></span></p>

</div></div><p class="MsoNormal" style="margin-left:36.0pt"><span lang="AR-SA" dir="RTL" style="color:#888888"><u></u> <u></u></span></p></div></div><p class="MsoNormal" style="margin-left:36.0pt"><br>_______________________________________________<br>

Perl mailing list<br><a href="mailto:Perl@perl.org.il" target="_blank">Perl@perl.org.il</a><br><a href="http://mail.perl.org.il/mailman/listinfo/perl" target="_blank">http://mail.perl.org.il/mailman/listinfo/perl</a><u></u><u></u></p>

</div><p class="MsoNormal" style="margin-left:36.0pt"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div><p class="MsoNormal" style="margin-left:36.0pt">-- <br>

Gaal Yahas &lt;<a href="mailto:gaal@forum2.org" target="_blank">gaal@forum2.org</a>&gt;<br><a href="http://gaal.livejournal.com/" target="_blank">http://gaal.livejournal.com/</a><u></u><u></u></p></div></div></div></div>
</div>
<br>_______________________________________________<br>
Perl mailing list<br>
<a href="mailto:Perl@perl.org.il" target="_blank">Perl@perl.org.il</a><br>
<a href="http://mail.perl.org.il/mailman/listinfo/perl" target="_blank">http://mail.perl.org.il/mailman/listinfo/perl</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="rtl"><br>

כותב הרצאות ? מדבר מול קהל ? הבלוג שלי <a href="http://publicspeakr.blogspot.com/" target="_blank">לומד לדבר</a> כתוב במיוחד בשבילך.<br></div></div><br>
</div></div></div></div>
<br>_______________________________________________<br>
Perl mailing list<br>
<a href="mailto:Perl@perl.org.il">Perl@perl.org.il</a><br>
<a href="http://mail.perl.org.il/mailman/listinfo/perl" target="_blank">http://mail.perl.org.il/mailman/listinfo/perl</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Gaal Yahas &lt;<a href="mailto:gaal@forum2.org">gaal@forum2.org</a>&gt;<br>
<a href="http://gaal.livejournal.com/">http://gaal.livejournal.com/</a><br>
</div></div></div></div>