<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 1, 2015 at 6:31 AM, Stefan <span dir="ltr">&lt;<a href="mailto:maillist@s.profanter.me" target="_blank">maillist@s.profanter.me</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="DE" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">if a URL parameter contains a Unicode character (e.g. <a href="http://www.example.com/?param=%D6lso%DF" target="_blank">www.example.com/?param=%D6lso%DF</a> which stands for param=Ölsoße), the parameter is not correctly parsed as Unicode.</span></p></div></div></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="DE" link="#0563C1" vlink="#954F72"><div><p><span lang="EN-US"><span>4.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><u></u><span lang="EN-US">This outputs for the example url: localhost:3000/?param=%D6lso%DF:<br><br><u></u><u></u></span></p><p><span lang="EN-US">[debug] $VAR1 = {<u></u><u></u></span></p><p><span lang="EN-US">          &#39;param&#39; =&gt; &quot;\x{fffd}lso\x{fffd}e&quot;<u></u><u></u></span></p><p><span lang="EN-US">        };<u></u><u></u></span></p><p><span lang="EN-US">[debug] $VAR1 = &#39;\x{d6}lso\x{df}e&#39;;<u></u><u></u></span></p><p><span lang="EN-US"><u></u> <u></u></span></p><p><span lang="EN-US"><u></u> <u></u></span></p><p style="margin-left:0cm"><span lang="EN-US">As you can see, the first output only contains one equal character: \x{fffd} which is obviously not the same as it should be: \x{d6}lso\x{df}e</span></p></div></div></blockquote><div><br></div><div><div>\x{fffd} is the unicode replacement character used by Encode to replace invalid UTF-8 sequences you are passing in.</div><div><br></div><div>Try this instead in your browser:</div><div><br></div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><div>?param=Ölsoße</div></div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>And then print $c-&gt;request-&gt;parameters-&gt;{param} -- and if you check Encode::is_utf8( $param ) it should be true, too, indicating the param was decoded correctly into characters. </div><div><br></div><div>Or if you prefer:</div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><div>perl -le &#39;use URI::Escape; print uri_escape( &quot;Ölsoße&quot; )&#39;</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div>%C3%96lso%C3%9Fe</div></div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>so,</div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div>?param=%C3%96lso%C3%9Fe</div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>but most likely the browser will turn it back into ?param=Ölsoße</div><div><br></div><div><br></div><div>If you really want to say you are using utf8 constant strings (i.e. &quot;use utf8;&quot;):</div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><div>$ perl -le &#39;use URI::Escape; use Encode; use utf8; use Encode; print uri_escape( encode_utf8( &quot;Ölsoße&quot; ) )&#39;</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div>%C3%96lso%C3%9Fe</div></div><div><br></div></div></div></blockquote>or<div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>$ perl -le &#39;use URI::Escape; use Encode; use utf8; use Encode; print uri_escape_utf8( &quot;Ölsoße&quot; )&#39;</div><div>%C3%96lso%C3%9Fe</div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>All the same thing.</div><div><br></div><div><br></div></div>-- <br><div class="gmail_signature">Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a></div>
</div></div></div>