in reply to Re: Tk causes problems with file paths containing non-Latin-1 chars
in thread Tk causes problems with file paths containing non-Latin-1 chars

Zentara: Your Encode::decode utf8 solution (which I found during experiments) is a fix for Linux and OS-X, but does not work for win32 (testing under XP only, no idea if Vista/W7 are different, but I can't see why they would be). For win32, the filename treatment required is
@files = map { pack 'UW*', unpack 'C*', $_; } @files;
The resultant string will now open and respond as expected to -d, -f, etc, but is no longer printable, or regex processable due to the "long char" problem. So I have to keep two copies, of the name: one for processing, one for display.

All that can be coded up via a simple package that decides:

I actually started doing that and the code got so horrible, I gave up took the coward's way out: added a known bug/limitation for Windows users (actually it was the inherent bug with Tk::FBox->getOpenFile barfing that made me give up)

[Updated to show who and what I'm replying to as the post is out of place for some reason].

  • Comment on Re^2: Tk causes problems with file paths containing non-Latin-1 chars
  • Download Code