in reply to How to detect the OS's current encoding?
I don't know if Tk's getOpenFile is buggy or not, but graff said that once you pass the filename through decode, Perl will tag it as unicode and do the right thing. Maybe you could make your own "custom-file-dialog" that preprocesses the dirlist with decode?#this decode utf8 routine is used so filenames with extended # ascii characters (unicode) in filenames, will work properly use Encode; opendir my $dh, $path or warn "Error: $!"; my @files = grep !/^\.\.?$/, readdir $dh; closedir $dh; # @files = map{ "$path/".$_ } sort @files; #$_ = decode( 'utf8', $_ ) for ( @files ); @files = map { decode( 'utf8', "$path/".$_ ) } sort @files;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to detect the OS's current encoding?
by chaoslawful (Acolyte) on Mar 01, 2007 at 15:37 UTC | |
by zentara (Cardinal) on Mar 01, 2007 at 18:13 UTC |