in reply to Re^3: Tk and Non-ASCII File Names
in thread Tk and Non-ASCII File Names
Thanks for your input. I tried decode but I'm still error-ridden; I've included the updates below. Any other ideas or encoding tricks where I can see what's going on under the hood?
Command Line Output:Tk Output:06_Protection_de_la_tête.xml: No such file or directory No such file or directory Assuming 'require Tk::ExecuteCommand;' at ./tmp.pl line 24
Code:06_Protection_de_la_tête.xml: No such file or directory
#!/usr/local/bin/perl use warnings; use strict; use Tk; use File::Find::Rule; use Encode qw(decode); #my $file = '06_Protection_de_la_tête.xml'; my @files = File::Find::Rule->file->name('*.xml')->in('.'); my $file = shift @files; $file = decode('iso-8859-1', $file); my $cmd = "ls -l $file"; ### Try ls. print qx($cmd); ### Try reading the first line. open my $F, '<', $file; print $! ? "$!\n" : scalar <$F> ; ### Try ls via Tk. my $mw = MainWindow->new; my $exec = $mw->ExecuteCommand( -command => $cmd, )->pack; $exec->execute_command; $exec->update; MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Tk and Non-ASCII File Names
by graff (Chancellor) on Oct 08, 2010 at 06:51 UTC | |
by eff_i_g (Curate) on Oct 08, 2010 at 13:56 UTC |