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-04-26 15:44:27 +0100, Peter Stephenson wrote:
> Unsetting all the LC_* variables (including LC_ALL) and setting only
> LC_CTYPE and LANG should be good enough, shouldn't it?  Something like:
> _comp_locale() {
>    # This exports new locale settings, so should only
>    # be run in a subshell.  A typical use is in a $(...).
>    local ctype=${${(f)"$(locale 2>/dev/null)"}:#^LC_CTYPE=*}
>    unset -m LC_\*
>    [[ -n $ctype ]] && eval export $ctype
>    export LANG=C
> }

I think it should work, but these settings should affect only the
svn command; I suppose that you need to run that in a subshell.

Note that since LC_ALL is unset and LANG is set to C, the LANGUAGE
environment variable will be ignored with the GNU libc (so, there
is no need to do anything about it).

> I've actually lost track of which of the above we're trying to fix up
> when we set the locale in this sort of case.  LC_COLLATE, certainly,
> and I think LC_MESSAGES since otherwise we can't parse it (although
> the disadvantage here is the output may be in a language the user
> doesn't understand).

If this is done only for parsing, the user wouldn't see the message.

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