better utf-8 handling

This commit is contained in:
romkatv 2019-08-20 14:56:43 +02:00
commit e537a0ee62
5 changed files with 21 additions and 16 deletions

View file

@ -5,7 +5,8 @@ setopt noaliases
() {
setopt extended_glob no_prompt_{bang,subst} prompt_{cr,percent,sp}
if [[ ${LC_ALL:-$LANG} != *.(utf|UTF)(-|)8 ]]; then
zmodload zsh/langinfo
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then
local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}
fi