Maybe I've overlooked the obvious (if so I apologise).
I have a simple perl program that walks a directory tree and - amongst other things - records each file and directory name in a text file. The host OS is Linux, and is configured to use UTF-8 for filenames; the contents of the output file are also encoded as UTF-8. I realise there are many pitfalls when dealing with Unicode and UTF-8, and this is obviously not dealing with a general case - but I would think it's a fairly commonplace requirement.
So, firstly, is there something analogous to "use open ':encoding(utf8)';" that will have an equivalent effect on the result(s) of "readdir(...);" or will I need to use "decode_utf8(readdir(...))" every time instead?
And secondly, is there likewise a way for a perl program to be notified that system calls that access the host filesystem - for example open(), stat(), readlink() - should encode filenames as UTF-8?
JohnIn reply to UTF-8 and readdir, etc. by jrw005
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |