This code:
my $encodings_test = 'ascii cp1252 cp437 cp850 iso-8859-1 utf-8-strict + utf8'; my $decoder = guess_encoding($data, qw/$encodings_test/); print "decoder: $decoder\n";
... does not what you think it does. qw does not interpolate strings into lists. You likely want:
my @encodings_test = qw(ascii cp1252 cp437 cp850 iso-8859-1 utf-8-stri +ct utf8); my $decoder = guess_encoding($data, @encodings_test);
... or if you want to keep your list of encodings as a string (why?!), split it into a list:
my $encodings_test = 'ascii cp1252 cp437 cp850 iso-8859-1 utf-8-strict + utf8'; my @encodings_test = split /\s+/, $encodings_test; my $decoder = guess_encoding($data, @encodings_test); print "decoder: $decoder\n";
In reply to Re^3: issue with Encode::Guess
by Corion
in thread issue with Encode::Guess
by toohoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |