Subject: | Incorrect handling of unicode with the test server |
Date: | Sun, 13 Jan 2008 14:05:51 +0100 |
To: | bug-Catalyst-Runtime [...] rt.cpan.org |
From: | Peter Rabbitson <rabbit+bugs [...] rabbit.us> |
Hi,
The test server (Catalyst::Engine::HTTP) does not seem to handle unicode at
all. What is worse - it throws exceptions when outputting three byte
characters. A very minimal (but complete) test script is attached. Three test
cases are PODed out, with notes explaining the behavior.
Cheers
Peter
#!/usr/bin/perl
package cat_test;
use warnings;
use strict;
use Catalyst::Runtime;
use Catalyst;
use Catalyst::Engine::HTTP;
my ($port, $char);
=begin this DOES NOT WORK (but does not throw an exception)
$ENV{CATALYST_ENGINE} ||= 'HTTP';
$port = 3000;
$char = "'\x{F0}'";
=cut
=begin this DOES NOT work (exception)
$ENV{CATALYST_ENGINE} ||= 'HTTP';
$port = 3000;
$char="'\x{F00}'";
=cut
=begin this WORKS (tested under apache 2.2)
$ENV{CATALYST_ENGINE} ||= 'FastCGI';
$char="'\x{F0}' and even '\x{F00}'";
=cut
__PACKAGE__->setup();
__PACKAGE__->run($port);
sub default : Private {
my ($self, $c) = @_;
$c->response->body ("This string contains a wide character: $char");
}