Welcome to the Monastery | |
PerlMonks |
Re^5: how to unicode filenames?by Corion (Patriarch) |
on Jun 28, 2012 at 07:05 UTC ( [id://978845]=note: print w/replies, xml ) | Need Help?? |
I'm sorry - I misunderstood your sentence ...and now most linux systems are using UTF-8 as native encoding and perl has no mechanism to deal with this? as relevant to the problem in the sense that you wanted Perl to automatically decode all filenames from UTF-8. I assumed you wanted an automagic solution becuase certainly you are aware of Encode and the common way of simply decoding all filenames from the filesystem by calling decode('UTF-8', $filename). If you can post some code where Perl actually munges the filename encoding, that would be interesting, because I am unaware of a situation where
produces any output. Of course, once you mix data from other sources than the file system and data from the filesystem functions, you need to be aware of the respective encodings and convert between them, but in absence of a short, self-contained example of Perl code (plus the type of file system and the filename, as hex), it's hard to advise you better. You continue your post with a paragraph that starts with The fix is simple... I'm not sure how your fix would address the problems you encounter, and how your fix would maintain backwards compatibility. Feel free to posit your ideas to the perl5-porters mailing list, or even better, supply working code, as that has the greatest chance of moving Perl in the direction you seem to want.
In Section
Seekers of Perl Wisdom
|
|