[Catalyst] Re: Unicode trouble with Catalyst::Engine::FastCGI

Bernhard Graf catalyst4 at augensalat.de
Mon Nov 23 18:53:52 GMT 2009


Aristotle Pagaltzis schrieb:

>> While this fixes the problem, it is still unclear, why the utf8
>> flag is set for the whole buffer.
> 
> It shouldn’t matter.

But it does.

>> So Ladies and Gentleman, may I present you the culprit? It is
>> YAML::XS! Everything read by YAML::XS
>>
>> perl -MYAML::XS -E '
>> my $config = YAML::XS::LoadFile("myapp.yml");
>> say((utf8::is_utf8($config->{name}) ? "is" : "is not"), " utf8");
>> '
>> is utf8
> 
> No, that’s not the culprit.
> 
> The culprit is Catalyst::Engine::FastCGI, which does not pay
> attention to the UTF8 flag.

Obviously YAML::XS doesn't do that either.

But aside from that I agree with you, that something ist broken in
F(ast)CGI. It seems more that F(ast)CGI pays attention to the utf8 flag
where it shouldn't, because it seems to automatically utf8::encode the
buffer due to the set utf8 flag.

> No. YAML::XS is completely correct.

No, it is not. Because it claims:

  This module exports the functions Dump and Load. These functions are
  intended to work exactly like YAML.pm's corresponding functions.

And that's not the case. And therefore you can't use it as a
drop-in-replacement for other YAML modules.


Bernhard Graf



More information about the Catalyst mailing list