in reply to Re: dos path accents
in thread dos path accents
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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: dos path accents
by Anonymous Monk on Oct 22, 2010 at 09:19 UTC | |
by Jim (Curate) on Oct 22, 2010 at 18:06 UTC | |
by Anonymous Monk on Oct 23, 2010 at 06:43 UTC | |
by Jim (Curate) on Oct 24, 2010 at 04:40 UTC | |
by Anonymous Monk on Oct 24, 2010 at 08:10 UTC |