Re: stty utf8

Jamie Lokier
2004-02-16T22:04:46Z

Jamie Lokier wrote:
> perl -e 'for (glob "*") { rename $_, "ņi-".$_ or die "rename: $!\n"; }'
>
> (NB: The prefix string is N WITH CEDILLA followed by "i-").
> (Hint: it mangles perfectly fine non-ASCII file names).
>
> Perl has no perfect behaviour to offer, because what should that
> behaviour be if readdir() might return a non-UTF-8 byte sequence
> as a name?

I've had someone point out that the perl script mangles non-UTF-8
filenames, and there is no correct behaviour for that case.

In fact the _real_ bug is that it mangles perfectly fine UTF-8 filenames.

It's a Perl quirk, but the behaviour is like that for compatibility
with non-UTF-8 filesystems. I wanted to show how just using UTF-8 for
filenames isn't _yet_ as straightforward as it should be.

-- Jamie