|
|
| There's more than one way to do things | |
| PerlMonks |
Re^6: encoding problem om Ubuntu Linuxby j.goor (Acolyte) |
| on Jun 20, 2008 at 11:46 UTC ( [id://693135]=note: print w/replies, xml ) | Need Help?? |
|
I't getting more and more complex... (putty was somehow reset to something other than UTF8 which made it all more tricky 1) the directory itself root@slarti:/media/usbdisk/music_org/scripts/test# ls /media/usbdisk/music/checkit/Crosby\,\ Stills\,\ Nash\ \&\ Young/ Déjà Vu So... that seems to be Ok (assuming this correctly being viewd while at UTF8) 2) The source file's content (part of it at least) root@slarti:/media/usbdisk/music_org/scripts/test# grep 'Crosby\,\ Stills\,\ Nash\ \&\ Young' mp3_v4.csv /media/usbdisk/music/checkit/Crosby, Stills, Nash & Young/D▒j▒ Vu/01 - Carry On.mp3;Crosby, Stills, Nash & Young;D?j?▒ Vu;Carry On;1;Rock;1970 Now, still being in UTF8 mode this does not look good 3) running a check-script of mine... #!/usr/bin/perl # INIT ---- use strict; use warnings; # VARS ---- # SUBS ---- # MAIN ---- print "Opening list...\n"; my $file = shift; open (F, $file) or die "$0\n"; while (my @fields = split /;/, <F>, 8) { unless (-f $fields[0]) { print $fields[0] . ": not found\n"; } } close (F); print "Ready\n"; Output: (part of it) root@slarti:/media/usbdisk/music_org/scripts/test# ./check_paths.pl mp3_v4.csv | grep Stills /media/usbdisk/music/checkit/Crosby, Stills, Nash & Young/D▒j▒ Vu/01 - Carry On.mp3: not found This means the path in the sourcefile does not match the actual subdirectory 4) The fun part: vi mp3_v2.csv /media/usbdisk/music/checkit/Crosby, Stills, Nash & Young/Déjà Vu/01 - Carry On.mp3;Crosby, Stills, Nash & Young;D?j?ï Vu;Carry On;1;Rock;1970 Compare this output to step 2 which does a grep on this very same file. Now all of a sudden it's looking good again. The source files has not been edited and all these outputs have been taken in the same putty windows while check before and aft on the encoding. UTF8 all the time. Now I'm puzzled. I think I'm gonna rub Buddha's belly - hopefully it'll provide me with some luck :-)
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||