in reply to Read text file - Encoding problem?
Hi,
just a hint to help yourself. Try to show the filenames in a hex representation. Than you can compare what you have in the file and what you get reading the directory. Make a simple example reducing the problem:
And like this code, open your csv file and read the entries in there.opendir my $dh, '.' or die "ERROR: Couldn't open: $!"; my @entries = readdir($dh); closedir $dh; foreach my $entry (@entries) { print "$entry\n"; print gethex($entry), "\n"; } sub gethex { my $v = shift; return join '', map { sprintf("%x-", ord) } split //, $v; }
Another hint: I can't see a explicit decoding while using read_file from File::Slurp. What do you get there? Are you sure that the csv file is create using UTF-8?
McA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read text file - Encoding problem?
by better (Acolyte) on Mar 17, 2013 at 10:53 UTC | |
by better (Acolyte) on Mar 17, 2013 at 12:18 UTC | |
by poj (Abbot) on Mar 17, 2013 at 12:50 UTC | |
by better (Acolyte) on Mar 17, 2013 at 15:14 UTC |