On Mon, Jul 03, 2017 at 09:35:06PM -0400, Dan Book wrote: > On Mon, Jul 3, 2017 at 8:38 PM, Tony Cook <tony@develop-help.com> wrote: > > > > > > As a side note, the original thread refers to: > > > > https://metacpan.org/source/SHAY/perl-5.24.1/cpan/Archive- > > Tar/lib/Archive/Tar.pm#L1501 > > > > which I could see as correct because of the way perl's unicode support > > (fails to) deal with filenames. > > > > Tony > > > > Not entirely correct IMO. If the intent is that filenames be encoded to > UTF-8, this will fail to encode downgraded names with non-ascii characters. If the caller creates a file using the name they pass in, encoding the name (which might not be utf-8 marked) may make the later -e or -l check fail. Perl functions such as open and stat currently ignore the the UTF-8 flag, which makes this pretty messy. The code in Archive::Tar seems a reasonable workaround to me, I don't think the author had much choice. TonyThread Previous | Thread Next