[Pkg-zsh-devel] Bug#654225: zsh: Multibyte fails when $LANG.utf variable is not set

Morten Bo Johansen mbj at spamcop.net
Mon Jan 2 15:47:14 UTC 2012


Frank Terbeck <ft at bewatermyfriend.org> wrote:

> Locale settings work like this: LC_* variables control the different
> pieces of the puzzle, when one of those is not set `LANG' is used as a
> fallback. `LC_ALL' is special, because it overrides all other LC_*
> variables and `LANG' becomes meaningless.

> [...]
> > Locale: LANGÚ_DK.utf8, LC_CTYPEÚ_DK.utf8 (charmap=UTF-8) (ignored: LC_ALL set to da_DK.utf8)

> You're setting `LC_ALL'. So the setting of `LANG' shouldn't matter at
> all.

But it does. It is completely reproducible. If $LANG is set to "da_DK"
then multibyte support is deactivated. If $LANG is "da_DK.utf8" then it
works.

> I did take a quick look at the involved code and I didn't see anything
> obviously wrong with it. `LANG' should *not* matter with `LC_ALL' set.
> If it does, that's a bug.

That was my opinion too.

> Can you give a minimal zsh setup and a simple way to trigger the problem
> you're seeing for further inspection?

Reproducing it is very simple. Just type export e.g. LANG=da_DK at the
prompt, then type in a multibyte character, type backspace or whatever
delete backwards key that you use and notice how it deletes the multibyte
character by octet. Type export LANG=da_DK.utf8 repeat the procedure and
notice how the character is now correctly deleted in one fell swoop.

I attach my rather small zshrc. ~/.zshenv is a symlink to ~/.environment
which just set a lot of environment variables. It is there that I now
specifiy the LANG variable which makes zsh behave correctly. zprofile and
zlogin are empty. On a sidenote, I did specifiy LANG=da_DK.utf8 in
/etc/default/locale along with LC_ALL=da_DK.utf8. This is supposedly the
right way to set your locale in Debian, but only the first line with
LC_ALL is read. Maybe I should file a bug report for that against the
locales package?

Thanks,

Morten
-------------- next part --------------
# The following lines were added by compinstall

zstyle ':completion:*' completer _complete
zstyle :compinstall filename '/home/mojo/.zshrc'

autoload -Uz compinit
autoload -U zmv
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
# history related
HISTFILE=~/.zshhistory
HISTSIZE=50000
SAVEHIST=50000
setopt APPENDHISTORY
setopt EXTENDEDGLOB
setopt HISTIGNOREALLDUPS
setopt HISTIGNORESPACE
setopt HISTREDUCEBLANKS
setopt HISTSAVENODUPS
setopt SHAREHISTORY
setopt INCAPPENDHISTORY
setopt AUTOCD
setopt CORRECT
bindkey -e
# End of lines configured by zsh-newuser-install

# PS1=$'%{\e[1;32m%}%n@%m%{\e[0m%}:%B%~/%b >%# '
# PS1=$'%B%~/%b >:# '
PS1=$'%B%~/%b %# '
#PS1="%{${bg[white]}${fg[red]}%}%(?..(%?%))%{${fg[yellow]}${bg[black]}%}%# "

if [[ -r ~/.aliases ]]; then
. ~/.aliases
fi

if [[ -r ~/.functions ]]; then
. ~/.functions
fi

if [[ -r ~/.environment ]]; then
. ~/.environment
fi

if [[ -r ~/bin/mc.sh ]]; then
. ~/bin/mc.sh
fi



More information about the Pkg-zsh-devel mailing list