I'm working on a Unix (Solaris) system with a file that has non-ASCII characters in its name. When I perform an ls the file name shows as 06_Protection_de_la_tête.xml and my locale is as follows:
LANG= LC_CTYPE=en_US.ISO8859-1 LC_NUMERIC=en_US.ISO8859-1 LC_TIME=en_US.ISO8859-1 LC_COLLATE=en_US.ISO8859-1 LC_MONETARY=en_US.ISO8859-1 LC_MESSAGES=C LC_ALL=
When I work with this file in Perl everything is OK until Tk (Tk::ExecuteCommand) enters the scene as shown/described below:
use warnings; use strict; use Tk; my $file = '06_Protection_de_la_tête.xml'; my $cmd = "ls -l $file"; ### This works. print qx($cmd); ### So does this. open my $F, '<', $file or die $!; print scalar <$F>; ### This fails. ### An error message states that the file cannot be found and the ### "LATIN SMALL LETTER E WITH CIRCUMFLEX" is shown in UTF-8. my $mw = MainWindow->new; my $exec = $mw->ExecuteCommand( -command => $cmd, )->pack; $exec->execute_command; $exec->update; MainLoop;
Here's the erroneous output:
06_Protection_de_la_tête.xml: No such file or directory
I've dug through Tk::ExecuteCommand and I cannot figure out why this error is surfacing.
Any ideas or pointers?
Thanks!
In reply to Tk and Non-ASCII File Names by eff_i_g
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |