浏览代码

Merge pull request #3563 from mcornella/fix-unicode-locale

Fix Unicode problems by only setting LC_CTYPE if not set
Robby Russell 9 年之前
父节点
当前提交
2f76919826
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      lib/misc.zsh

+ 5 - 2
lib/misc.zsh

@@ -9,11 +9,14 @@ setopt long_list_jobs
 export PAGER="less"
 export LESS="-R"
 
-export LC_CTYPE=$LANG
-
 ## super user alias
 alias _='sudo'
 alias please='sudo'
 
 ## more intelligent acking for ubuntu users
 alias afind='ack-grep -il'
+
+# only define LC_CTYPE if undefined
+if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
+	export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
+fi