Thank you!
I still like to use getOpenFile, as it offers a fine TK funtionality to select files in Windows. I changed my subrutine a little bit adding Win32::GetShortPathName() as you suggested. It works fine now. Here is the new script:
sub convert_ansi_to_utf {
my $types = [ ['Text', '.txt'],
['All Files', '*'],];
my $filename= $frame_kwic_setup->getOpenFile(-filetypes => $types);
use Win32;
my $shortpath = Win32::GetShortPathName( "$filename" );
open(F, "<:encoding(iso-8859-1)", "$shortpath") or die $!;
open(G, ">:utf8", "$shortpath.utf.txt") or die $!;
while (<F>) { print G }
close (F);
close (G);
}
|