note
jbert
Hmm...are you sure the file in in utf8? E9 is latin1 for e-acute.
<p>
Can you dump the hex values and check? (or just try code below).
<p>
If your users are entering latin-1, then you could use the Encode module to shift the script to utf8.
<c>
#!/usr/bin/perl
use strict;
use warnings;
use Encode;
use utf8;
my $code = <<"EOLATINCODE";
my \$var_with_\xE9_accent = 10;
print \"var is \$var_with_\xE9_accent\\n\";
EOLATINCODE
$code = decode('latin1', $code);
print "CODE is $code\n";
eval $code;
if ($@) {
print "DIED: $@\n";
}
</c>
You don't seem to need 'use utf8' in the eval'd code in this case, but you seem to need it in the containing script.
651153
651179