From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6421 invoked by alias); 25 Apr 2010 14:16:48 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27905 Received: (qmail 15844 invoked from network); 25 Apr 2010 14:16:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Subject: Re: vcs_info and locales In-Reply-To: <20100425131944.GA55789@redoubt.spodhuis.org> (Phil Pennock's message of "Sun, 25 Apr 2010 06:19:44 -0700") References: <20100424234017.776ae0ea@coriolan> <87aassncyk.fsf@ft.bewatermyfriend.org> <20100425131944.GA55789@redoubt.spodhuis.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Date: Sun, 25 Apr 2010 16:09:31 +0200 Message-ID: <8739yjoc84.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: 430444 Phil Pennock wrote: > 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? > > 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 > data. > > I think the safest algorithm is not to set LC_ALL but instead: > * set LC_MESSAGES=3DC > * if LC_ALL is set and is not C, set LANG=3D$LC_ALL, unset LC_ALL > > Make sense? Probably true. Although, I'd expect programs you can use for scripting to use untempered byte sequences. But then, where is the boundary for programs that are used for scripting and pure user-interface programs... `svn info' is probably a pretty blurry example already. I'm not an expert but I think your proposal is sound. Here's a patch that does exactly that. It would be good if Fran=C3=A7ois could test whether this works for him. Regards, Frank ---------- >8 ---------- >>From 95f005d1d8a5791eb8937b745adbd65ac62828f4 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Sun, 25 Apr 2010 16:00:09 +0200 Subject: PATCH: vcs_info: Avoid locale related problems MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This is to avoid problems with output from external commands with non-C locales as reported by Fran=C3=A7ois Gannaz in workers-27900. --- Functions/VCS_Info/vcs_info | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info index a9e65e1..6585e7a 100644 --- a/Functions/VCS_Info/vcs_info +++ b/Functions/VCS_Info/vcs_info @@ -47,11 +47,16 @@ vcs_info () { local pat local -i found local -a enabled disabled dps - local -x usercontext vcs rrn + local -x usercontext vcs rrn LC_MESSAGES local -ix maxexports local -ax msgs local -Ax vcs_comm =20 + LC_MESSAGES=3DC + if [[ -n ${LC_ALL} ]]; then + local -x LANG LC_ALL + LANG=3D${LC_ALL} + fi vcs=3D'-init-'; rrn=3D'-all-' usercontext=3D${1:-default} =20 --=20 1.7.0