Thread -e bringt unterschiedliche Ergebnisse: Ursachen? (18 answers)
Opened by pktm at 2007-03-22 22:43

GoodFella
 2007-03-24 02:57
#75282 #75282
User since
2007-01-09
192 Artikel
BenutzerIn
[default_avatar]
Waren 2. Einen davon hab ich gefunden: http://board.perl-community.de/cgi-bin....;t=3837

Der andere ist leider unauffindbar :/


Hab mal meine subs aus dem Script, dass ich gerade bearbeite rauskopiert, die funktionieren mit Umlauten, getestet:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use locale;
sub file_dialog
 {
  my $parent = shift;
  my @types =( ['All files',         '*'],
               ['CSV files',      '.csv'],
               ['Excel files',    '.xls'] );
  my $value = $parent->getOpenFile( -filetypes => \@types, -initialdir => '.' );
  $value =~ s/\//\\/sgi;
  utf8::downgrade($value);
  unless($value eq '')
   {
    chdir(&get_path($value));
   }
  return($value);
 }

sub save_file_dialog
 {
  my ($parent, $filename) = @_;
  my @types =( ['Excel files',    '.xls'],
               ['All files',      '*.*' ] );
  my $value = $parent->getSaveFile( -filetypes => \@types, -initialdir => '.', -initialfile => $filename);
  $value =~ s/\//\\/sgi;
  utf8::downgrade($value); 
  return($value); 
 }


.. und zusätzlich später:

Code (perl): (dl )
1
2
  utf8::downgrade($file);
  unless (-e $file) { ........



Ich finde ja, Perl sollte all das allein machen.\n\n

<!--EDIT|GoodFella|1174698275-->

View full thread -e bringt unterschiedliche Ergebnisse: Ursachen?