zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Subversion completion don't work with UTF8 (and other) file names
Date: Sat, 4 May 2013 14:23:55 +0100	[thread overview]
Message-ID: <20130504142355.0fdaf612@pws-pc.ntlworld.com> (raw)
In-Reply-To: <19868.1367633701@thecus.kiddle.eu>

On Sat, 04 May 2013 04:15:01 +0200
Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> Is the locale command that portable?.

That's easy to work around.

> I'm not sure this is even necessary in the cases where it is just calling
> svnadmin help or svn help rather than svn status.
> 
> Originally, _subversion set LC_MESSAGES for these commands but LC_ALL
> overrides LC_MESSAGES. Would it be better to do it as follows:
>   LC_CTYPE=${LC_ALL:-${LC_CTYPE:-$LANG}} LC_ALL= LC_MESSAGES=C _call_program ...

So that goes back to my previous question, what do we actually need to
change to make it work regardless of locale?

diff --git a/Completion/Base/Utility/_comp_locale b/Completion/Base/Utility/_comp_locale
index 1987043..7cf8511 100644
--- a/Completion/Base/Utility/_comp_locale
+++ b/Completion/Base/Utility/_comp_locale
@@ -7,7 +7,14 @@
 # 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
+local ctype
+
+if ctype=${${(f)"$(locale 2>/dev/null)"}:#^LC_CTYPE=*}; then
+    unset -m LC_\*
+    [[ -n $ctype ]] && eval export $ctype
+else
+    ctype=${LC_ALL:-${LC_CTYPE:-$LANG}}
+    unset -m LC_\*
+    export LC_CTYPE=$ctype
+fi
 export LANG=C

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2013-05-04 13:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26 11:51 Paul Romanchenko
2013-04-26 12:39 ` Vincent Lefevre
2013-04-26 14:44   ` Peter Stephenson
2013-04-26 15:35     ` Vincent Lefevre
2013-04-29  8:57       ` Peter Stephenson
2013-04-29 13:58         ` Bart Schaefer
2013-05-04  2:15         ` Oliver Kiddle
2013-05-04 13:23           ` Peter Stephenson [this message]
2013-05-07  7:38             ` Oliver Kiddle
2013-05-07  9:21               ` Peter Stephenson
2013-05-14 13:28                 ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130504142355.0fdaf612@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).