in reply to Re^2: Tk and Non-ASCII File Names
in thread Tk and Non-ASCII File Names
So your Encode::decode call should specify that the string being passed to it needs to be decoded from that encoding:
Try that and see if it helps. The return value should be a valid utf8 string with the accented "e" rendered as intended, because the value being passed in $file is a valid 8859-1 string.my $file = decode( 'iso-8859-1', $file );
When you passed 'utf-8' as the first arg to decode(), perl was being told to expect utf8 data in $file, but the single non-ascii byte there was not parsable as utf8, and what you got in place of it was the unicode "REPLACEMENT CHARACTER" (U+FFFD), which, when rendered as utf8 data, is the three-byte sequence "0xef 0xbf 0xbd", and that sequence, when played through a Latin-1 display window, yields the three goofy characters that you got.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Tk and Non-ASCII File Names
by eff_i_g (Curate) on Oct 06, 2010 at 17:22 UTC | |
by graff (Chancellor) on Oct 08, 2010 at 06:51 UTC | |
by eff_i_g (Curate) on Oct 08, 2010 at 13:56 UTC |