in reply to Handling file path with unusual characters
Encoding issues are notoriously tricky — in particular when filenames are involved. And with the info you've provided it's not exactly easy to come up with a do-that-and-you'll-be-happy recipe solution :)
The first step when debugging encoding problems is to find out what encodings are involved. In this particular case, it would be important to know the encoding the filesystem uses for filenames. Once you know that, you can decode the filenames on input (coming from the filesystem), and encode them on output from/to the respective encoding being used. Perl's handling of filenames does not involve any fancy auto-conversion magic, it's all plain octets. (Even on OSses like Windows, where there is a Unicode interface (aka "wide API") for filenames - meaning the OS would take care of converting from/to the system's native encoding - Perl does currently not make use of it.)
OTOH, tk___getOpenFile() might be doing its own thing... (I've never used tkx, so I can't tell). In other words, you'd have to check whether the names for the selected file(s) are still in the same (raw) encoding being used in the filesystem. To check such questions, it's always a good idea to use hexdumps or, better yet, Devel::Peek (which also informs about the state of Perl's utf8 flag) — simply printing the strings to your terminal, or viewing them in your favorite editor, browser, or some such, might involve implicit encoding conversions, font issues, etc. that all in all will typically only serve to confuse matters even more... (unless you know your tools very well).
|
|---|