Zsh Mailing List Archive
Messages sorted by:
Re: vcs_info and locales
- X-seq: zsh-workers 27910
- From: FranÃois Gannaz <francois.gannaz@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: vcs_info and locales
- Date: Sun, 25 Apr 2010 21:09:22 +0200
- In-reply-to: <20100425131944.GA55789@xxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20100424234017.776ae0ea@coriolan> <87aassncyk.fsf@xxxxxxxxxxxxxxxxxxxxxx> <20100425131944.GA55789@xxxxxxxxxxxxxxxxxxxx>
Le 2010-04-25, Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> a Ãcrit :
> On 2010-04-25 at 10:38 +0200, Frank Terbeck wrote:
> > Anyway, could you try the following patch for the locale problem? I
> > think it should solve the issue once and for all.
> I have one concern, which leads to the question: is it really necessary
> to set LC_ALL instead of LC_MESSAGES?
Yes it is. I used LC_ALL here because that was the only one that made "svn
info" switch to English when default locale is set to "fr_FR.utf8".
% LC_ALL=C svn info
% LC_MESSAGES=C LANG=C LC_CTYPE=C svn info
> The main problem is that when you override LC_CTYPE to C, you lose any
> potential UTF-8 support, unless the tool just passes through the binary
> I think the safest algorithm is not to set LC_ALL but instead:
> * set LC_MESSAGES=C
> * if LC_ALL is set and is not C, set LANG=$LC_ALL, unset LC_ALL
> Make sense?
I had not tested what non-ASCII encoding became, and you're right that the
shell can't handle utf-8 anymore.
% LC_ALL=C svn log
r1 | zamansky | 2010-04-25 20:46:26 +0200 (Sun, 25 Apr 2010) | 2 lines
Accentu?\195?\169 l?\195?\160 aussi. ?\195?\128 tester.
So setting LC_ALL=C globally is indeed a bad idea. But why not just locally in
VCS_INFO_get_data_svn? I don't think that behavior would hurt much vcs_info.
The only problem I can think of is when the repository name is not un ASCII,
and doing this really calls for troubles ;-)
With a "franÃois" repository and LC_ALL=C:
% vcs_info command ; vcs_info_lastmsg
$vcs_info_msg_0_: "svn:(franfranÃois37ois:1) "
The other solution would be to use the line numbers to fetch the data from "svn
Messages sorted by: