Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Subversion completion don't work with UTF8 (and other) file names



On 2013-05-07 10:21:15 +0100, Peter Stephenson wrote:
> I suppose I was asking the more general question: given a utility we
> need output from, is it OK to keep LC_CTYPE and set everything else
> to C or is there something else going on?

It depends on the utility. With some utilities, you may want to
set LC_CTYPE to C in order to avoid non-ASCII characters and/or
get charset-independent output.

For instance, with the US-ASCII charmap,

$ LANG=C LC_CTYPE=C cp foo
cp: missing destination file operand after 'foo'
Try 'cp --help' for more information.

but with the UTF-8 charmap,

$ LANG=C LC_CTYPE=C.UTF-8 cp foo
cp: missing destination file operand after ‘foo’
Try 'cp --help' for more information.

The quotes of foo are non-ASCII ones in the latter case.

But if the filename can have non-ASCII characters...

$ LANG=C LC_CTYPE=C cp aéb
cp: missing destination file operand after 'a\303\251b'
Try 'cp --help' for more information.

while one gets the accented character in UTF-8:

$ LANG=C LC_CTYPE=C.UTF-8 cp aéb
cp: missing destination file operand after ‘aéb’
Try 'cp --help' for more information.

but things get complex if the filename has special characters
(even ASCII ones)...

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author