Probleme mit Umlauten in Dateinamen
Niki hat Probleme mit Dateinamen mit Umlauten umzugehen. Es scheint mit Perl/Tk oder Tk zusammen zu hängen. Beim NikiAutor führt das folgende Programm zu einem Fehler. Es legt allerdings im aktuellen Verzeichnis die Schöne_Datei an.
#!/usr/bin/perl -w
use strict;
use Tk;
my $file = "Schöne_Datei";
my $error = '';
open ( FIL, ">$file" ) or die "Error opening '$file': $!";
close FIL;
my $top = Tk::MainWindow->new;
$top->Label ( -textvariable => \$file )->pack ();
$top->Label ( -textvariable => \$error )->pack ();
$top->Button ( -text => 'Test',
-command => sub { open ( FIL, "<$file" ) or $error = "opening '$file': $!";
close FIL;
open ( FIL, "<$file" ) or die "error opening '$file': $!";
close FIL;
}
)->pack ();
$top->Button ( -text => 'Quit',
-command => sub { exit; }
)->pack ();
Tk::MainLoop;
Wissen Sie eine Lösung für dieses Problem? Bitte senden Sie eine Mail an hkuhlmann@dr-kuhlmann-software.de