From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25128 invoked by alias); 25 Apr 2010 19:09:54 -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: 27910 Received: (qmail 4673 invoked from network); 25 Apr 2010 19:09:50 -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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at free.fr does not designate permitted sender hosts) Date: Sun, 25 Apr 2010 21:09:22 +0200 From: =?UTF-8?B?RnJhbsOnb2lz?= Gannaz To: zsh-workers@zsh.org Subject: Re: vcs_info and locales Message-ID: <20100425210922.13596c4f@coriolan> In-Reply-To: <20100425131944.GA55789@redoubt.spodhuis.org> References: <20100424234017.776ae0ea@coriolan> <87aassncyk.fsf@ft.bewatermyfriend.org> <20100425131944.GA55789@redoubt.spodhuis.org> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.20.0; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le 2010-04-25, Phil Pennock a =C3= =A9crit : > 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. >=20 > 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=3DC svn info =20 Path: . [...] % LC_MESSAGES=3DC LANG=3DC LC_CTYPE=3DC svn info Chemin=C2=A0: . [...] =20 > 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. >=20 > 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 >=20 > 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=3DC svn log =20 ------------------------------------------------------------------------ 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=3DC globally is indeed a bad idea. But why not just local= ly 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=C3=A7ois" repository and LC_ALL=3DC: % vcs_info command ; vcs_info_lastmsg =20 $vcs_info_msg_0_: "svn:(franfran=C3=A7ois37ois:1) " The other solution would be to use the line numbers to fetch the data from = "svn info". -- Fran=C3=A7ois