<div dir="ltr">Tere!<br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-26 16:49 GMT+03:00 Warren Young <span dir="ltr"><<a href="mailto:warren@etr-usa.com" target="_blank">warren@etr-usa.com</a>></span>:</div>
<div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'm getting data corruption when a UTF-8 encoded web page sends form data back to Dancer via POST.<br>
<br>
</blockquote><div>... </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
2. Add a POST handler route to utf8form/lib/<a href="http://utf8form.pm" target="_blank">utf8form.pm</a>:<br>
<br>
post '/submit' => sub {<br>
debug "Got '", param('field'), "' from form.";<br>
};<br><br></blockquote><div><br></div><div>Actually, your code uses here STDERR and seems to me, that Dancer does not take care of it, so in your ./bin/<a href="http://app.pl">app.pl</a> you should add this:</div><div>
<br></div><div> binmode(STDERR, ":encoding(UTF-8)");</div><div><br></div><div>But this cures only STDERR, for any other output you may have, you must take care same or similar way. I assume, in views you see UTF-8 correctly. At least I saw with your testcase. </div>
</div><div><br></div>-- </div><div class="gmail_extra">Wbr,<br>Kõike hääd,<br><br>Gunnar</div></div>