From 7c30c44cfe91f64624352da58a330623fa0af3bc Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sun, 12 Mar 2017 17:01:38 +0100 Subject: [PATCH] 12_locale: Only Linux seems to lowercase & transform the encoding At least macOS and FreeBSD use the "raw" form. But note that Linux uses the raw from as well for the "C.UTF-8" locale and not the transformed "C.utf8", so add an exception for this case. --- core/12_locale/12_locale.zprofile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/12_locale/12_locale.zprofile b/core/12_locale/12_locale.zprofile index 04d8a2a..e6256ee 100644 --- a/core/12_locale/12_locale.zprofile +++ b/core/12_locale/12_locale.zprofile @@ -11,7 +11,9 @@ while true; do lc_messages=$(locale 2>/dev/null | fgrep LC_MESSAGES | cut -d'=' -f2) lc_messages=$lc_messages:gs/\"// locale=$lc_messages:r - encoding=$lc_messages:e:l:gs/-// + [[ "$OSTYPE" = 'linux-gnu' && $locale != 'C' ]] \ + && encoding=$lc_messages:e:l:gs/-// \ + || encoding=$lc_messages:e [[ -n "$encoding" ]] && locale="$locale.$encoding" [[ -z "$LANG$LANGUAGE$LC_ALL$LC_MESSAGES" ]] && unset lc_messages -- 2.39.2