diff options
Diffstat (limited to 'internal/icons.zsh')
-rwxr-xr-x | internal/icons.zsh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/internal/icons.zsh b/internal/icons.zsh index e93712c4..fd2ab1be 100755 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -3,9 +3,11 @@ typeset -gA icons function _p9k_init_icons() { [[ $+_p9k_icon_mode == 1 && $_p9k_icon_mode == $POWERLEVEL9K_MODE ]] && return typeset -g _p9k_icon_mode=$POWERLEVEL9K_MODE - typeset -g _p9k_locale=${LC_ALL:-$LANG} - if [[ $_p9k_locale != *.(utf|UTF)(-|)8 ]]; then - _p9k_locale=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8} + zmodload zsh/langinfo + if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then + typeset -g _p9k_locale=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8} + else + typeset -g _p9k_locale= fi case $POWERLEVEL9K_MODE in @@ -535,7 +537,7 @@ function _p9k_init_icons() { function print_icon() { emulate -L zsh && setopt no_hist_expand extended_glob no_prompt_bang prompt_{cr,percent,subst,sp} _p9k_init_icons - local LC_ALL=$_p9k_locale + [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale local icon_name=$1 local var_name=POWERLEVEL9K_${icon_name} if [[ -n "${(tP)var_name}" ]]; then @@ -553,7 +555,7 @@ function print_icon() { function get_icon_names() { emulate -L zsh && setopt no_hist_expand extended_glob no_prompt_bang prompt_{cr,percent,subst,sp} _p9k_init_icons - local LC_ALL=$_p9k_locale + [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale # Iterate over a ordered list of keys of the icons array for key in ${(@kon)icons}; do echo -n "POWERLEVEL9K_$key: " |