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 () { print G } close (F); close (G); }