develooper Front page | perl.perl5.porters | Postings from July 2017

Re: [perl #131685] Rename utf8::is_utf8() (and other functions)

Thread Previous | Thread Next
Tony Cook
July 4, 2017 01:59
Re: [perl #131685] Rename utf8::is_utf8() (and other functions)
Message ID:
On Mon, Jul 03, 2017 at 09:35:06PM -0400, Dan Book wrote:
> On Mon, Jul 3, 2017 at 8:38 PM, Tony Cook <> wrote:
> >
> >
> > As a side note, the original thread refers to:
> >
> >
> > Tar/lib/Archive/
> >
> > 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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About