<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hey all,<div><br></div><div>on most of my website running on (latest catalyst: 5.90065) i always get utf8 related errors.</div><div>the usually appear if a spider </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Mozilla/5.0 (compatible; EasouSpider; +<a href="http://www.easou.com/search/spider.html">http://www.easou.com/search/spider.html</a>)</div><div>comes accross.</div><div><br></div><div>the error is:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Caught exception in engine "UTF8 Error: utf8 "\x98" does not map to Unicode at /usr/local/…./lib/perl5/Catalyst/Plugin/Unicode/Encoding.pm line 167.</div><div><br></div><div>It took me while to get the actual parameters the spiders sends because the debug-message of catalyst do not tell that much :...</div><div><br></div><div>—————————————</div><div>[2014/07/16 15:08:47] [5.255.253.218] [INFO] vim /usr/local/…./lib/perl5/Catalyst.pm +2016: *** Request 164 (0.032/s) [10682] [Wed Jul 16 15:08:47 2014] ***<br>[2014/07/16 15:08:47] [5.255.253.218] [DEBUG] vim /usr/local/…./lib/perl5/Catalyst.pm +2309: Response Code: 400; Content-Type: text/plain; charset=UTF-8; Content-Length: unknown<br>[2014/07/16 15:08:47] [5.255.253.218] [INFO] vim /usr/local/.../lib/perl5/Catalyst.pm +1880: Request took 0.006491s (154.059/s)<br>.---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------.<br>| Action | Time |<br>+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+<br>'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------'</div><div>—————————————</div><div><br></div><div>i changed to Plugin::Unicode::Encoding plugin a bit to find out what the client sends … the results are these:</div><div>UTF8 trash arrives - and the module seems unable to deal with it…</div><div><br></div><div>————————————</div><div>Caught exception in engine "UTF8 Error: utf8 "\x98" does not map to Unicode at /usr/local/…../lib/perl5/Catalyst/Plugin/Unicode/Encoding.pm line 170.<br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^P<8e>ô^P^@^@^@^@ <88>ô^P^@^@^@^@Ð<82>ô^P^@^@^@^@ <8d>ô^P^@^@^@^@<90><95>ô^P^@^@^@^@à<90>ô^P^@^@^@^@@<95>ô^P^@^@^@^@P<8f>ô^P^@^@^@^@<90><81>ô^P^@^@^@^@ <97>ô^P^@^@^@^@Ð<8c>ô^P^@^@^@^@p<88>ô^P^@^@^@^@P<99>ô^P^@^@^@^@<90><90>ô^P^@^@^@^@@<9a>ô^P^@^@^@^@0<9b>ô^P^@^@^@';<br><br><br>headers: Connection: close<br>Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1<br>Accept-Encoding: gzip, deflate<br>Accept-Language: zh;q=0.9,en;q=0.8<br>Host: <a href="http://wbc-inco.net">wbc-inco.net</a><br>User-Agent: Mozilla/5.0 (compatible; EasouSpider; +<a href="http://www.easou.com/search/spider.html">http://www.easou.com/search/spider.html</a>)<br>Content-Length: 927<br>Content-Type: application/x-www-form-urlencoded<br>REFER: <a href="http://b------.net/“">http://b------.net/“</a></div><div><br></div><div>————————————<br><br></div><div>to understand the logging above: this is what i added /changed in the Catalyst::Plugin::Unicode::Encoding</div><div><br></div><div>————————————————————</div><div>around line 168:</div><div><br></div><div> my $val;<br> eval {<br> $val = Encode::is_utf8( $value ) ? $value : $enc->decode( $value, $CHECK );<br> };<br> if ($@){<br> # UPS !<br> # get request infos<br>use Data::Dumper;<br>my $params = $self->req->parameters;<br>my $headers= $self->req->headers->as_string;<br>die "UTF8 Error: $@ - \n\nURL: " . $self->req->path . "\n\nPARAMS:" . Dumper( $params ) . "\n\n // value: " . Dumper($value) . "\n\nheaders: " . $headers;<br>….</div><div>————————————————————</div><div><br></div><div>I guess my Catalyst Apps are not the only ones with these errors ?</div><div><br></div><div><br></div><div>about my App settings / config:</div><div><br></div><div>app-config has</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>encoding UTF-8</div></div><div><br></div><div>App.pm does not load Unicode::Encoding anymore (since this is not need when using latest Catalyst: 5.90065)</div><div><br></div><div>i am using postgres with</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>pg_enable_utf8 1</div><div>(but the error about is far away from any DB related problem i guess)</div><div><br></div><div>using Catalyst::Plugin::Unicode::Encoding version 2.1 (coming with catalyxt)</div><div><br></div><div>i just checked out the tracker for catalyst on cpan, there is an UTF8 issue ticket</div><div><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://rt.cpan.org/Public/Bug/Display.html?id=94957">https://rt.cpan.org/Public/Bug/Display.html?id=94957</a></div><div>but i does not look as it was this problem ...</div><div><br></div><div>Any ideas what todo ?</div><div>Add a issue/ticket ?</div><div><br></div><div>thanks for feedback,</div><div>bernhard bauch<span class="Apple-tab-span" style="white-space: pre;">        </span></div><div><br></div><div><br></div><div><br><div>
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>—</div><div>Bernhard Bauch, Webdevelopment<br>ZSI - Zentrum für soziale Innovation<br><a href="mailto:bauch@zsi.at">bauch@zsi.at</a><br>Skype: berni-zsi</div></div>
</div>
<br></div></body></html>