Detect utf8 better?

Tue, 14 Feb 2017 12:44:57 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Tue, 14 Feb 2017 12:44:57 -0500
changeset 518
b668b49f6153
parent 517
8d4021a00228
child 519
42e8433b8a51

Detect utf8 better?

.oh-my-zsh.cust/themes/mhoward.zsh-theme file | annotate | diff | comparison | revisions
--- a/.oh-my-zsh.cust/themes/mhoward.zsh-theme
+++ b/.oh-my-zsh.cust/themes/mhoward.zsh-theme
@@ -25,7 +25,7 @@ PROMPT_SUCCESS_COLOR=$FG[071]
 PROMPT_FAILURE_COLOR=$FG[124]
 PROMPT_VCS_INFO_COLOR=$FG[242]
 
-if [[ ! $LC_CTYPE =~ 'UTF-8$' || "$(print -P %l)" =~ '^[0-9v]' ]]
+if [[ ! "$(locale LC_CTYPE 2>/dev/null)" =~ 'UTF-8' || "$(print -P %l)" =~ '^[0-9v]' ]]
 then
   PROMPT_DEFAULT_END='%%'
   PROMPT_ROOT_END='#'

mercurial