in reply to Re^4: Tk and Non-ASCII File Names
in thread Tk and Non-ASCII File Names

In case you didn't know, the strings you just posted as the "Command Line Output" and "Tk Output" both contain a valid utf8 character ("e with circumflex"); it looks bad because both your shell terminal window and your Tk window are using iso-8859-1 encoding to display the data; the two "wrong" characters that you see are actually the two bytes of the utf8-encoded character, being interpreted as separate 8859-1 characters instead.

Having the string in utf8 encoding probably explains why the open() fails as well -- you've actually "changed" the file name (the value of $file), by changing the encoding.

So, I'm a little confused about the nature of the original problem... What happens if you take this most recent instance of your code (using File::Find::Rule), and comment out this line?

$file = decode('iso-8859-1', $file );

Replies are listed 'Best First'.
Re^6: Tk and Non-ASCII File Names
by eff_i_g (Curate) on Oct 08, 2010 at 13:56 UTC
    graff,

    Aye, the UTF-8 is valid, but my locale is en_US.ISO8859-1 (or at least some of it is; see my original post).

    If I comment out the encoding line the ls works as well as reading a line from the file, but Tk still reports:

    06_Protection_de_la_tĂȘte.xml: No such file or directory

    Back to the original problem: without any fancy stuff (decoding, encoding, etc.) commands with non-ASCII characters work fine except when they are ran through Tk::ExecuteCommand, which is what I'm trying to fix because it's a Tk application;the others are just examples. I posted a solution for this in an earlier reply, but it involves changing the module's code and I'm not sure how wise that is—if I'm fixing a valid bug or creating a potential problem for the future.

    Thanks for sticking with me on this one!