<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1468944360128_4375" dir="ltr">Looks like to a bug to me, although I'm not personally keen on the auto length setting in Catalyst it should be corrected. I'm happy to get a patch, or at the very least give me a broken test case (checkout <a href="https://github.com/perl-catalyst/catalyst-runtime/blob/master/t/utf_incoming.t" class="" id="yui_3_16_0_1_1468944360128_4381">https://github.com/perl-catalyst/catalyst-runtime/blob/master/t/utf_incoming.t</a> </div><div id="yui_3_16_0_1_1468944360128_4452"><br></div><div id="yui_3_16_0_1_1468944360128_4452" dir="ltr">and see if you can help me figure it out -jnap</div><div id="yui_3_16_0_1_1468944360128_4452" dir="ltr"><br></div><div id="yui_3_16_0_1_1468944360128_4452" dir="ltr">(created an issues for this, _<a href="https://github.com/perl-catalyst/catalyst-runtime/issues/143" class="" id="yui_3_16_0_1_1468944360128_5338">https://github.com/perl-catalyst/catalyst-runtime/issues/143</a></div><div id="yui_3_16_0_1_1468944360128_5347"><br></div><div><br></div><div id="yui_3_16_0_1_1468944360128_4390"><br></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Friday, July 15, 2016 6:07 AM, Kroshka Yenot <trashbox@cary.lv> wrote:<br></font></div> <br><br> <div class="y_msg_container"><div id="yiv5370434440">
<div>
<div>Hi!</div>
<div>if content type is 'application/json' or 'application/json;
charset=utf-8' Catalyst sets content length in chars, NOT IN BYTES
and I'm getting <br>
</div>
<div>{"id":1, "msg":"В Питере</div>
<div>if content type is 'text/html' Catalyst sets content length in
bytes (properly) and everything works fine<br>
</div>
<div>Is there any workaround to configure this <span class="yiv5370434440g-active-word yiv5370434440js-active-word"><span class="yiv5370434440translation">behaviour</span></span><span class="yiv5370434440translation">, except setting content length manually
everytime ?</span><br>
</div>
<div><br>
</div>
<div>my $json_text = '{"id":1, "msg":"В Питере пить"}';<br>
</div>
<div>$c->response->content_type('application/json');<br>
$c->response->content_length(bytes::length $json_text);<br>
$c->response->body($json_text);<br>
</div>
<div>Thanks in advance<br>
</div>
<div><br>
</div>
</div>
</div><br>_______________________________________________<br>List: <a ymailto="mailto:Catalyst@lists.scsys.co.uk" href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br><br><br></div> </div> </div> </div></div></body></html>