Subject: | YAML::XS sets utf8 flag on everything |
All data read with YAML::XS seems to have the utf8 flag on:
perl -MYAML::XS -E '
my $config = YAML::XS::LoadFile("myapp.yml");
say((utf8::is_utf8($config->{name}) ? "is" : "is not"), " utf8");
'
is utf8
This can lead to unpredictable results, as e.g. described here:
http://lists.scsys.co.uk/pipermail/catalyst/2009-November/023907.html
http://lists.scsys.co.uk/pipermail/catalyst/2009-November/023918.html
On the other hand:
perl -MYAML::Syck -E '
my $config = YAML::Syck::LoadFile("myapp.yml");
say((utf8::is_utf8($config->{name}) ? "is" : "is not"), " utf8");
'
is not utf8
perl -MYAML -E '
my $config = YAML::LoadFile("myapp.yml");
say((utf8::is_utf8($config->{name}) ? "is" : "is not"), " utf8");
'
is not utf8