]> arthur.barton.de Git - ax-zsh.git/blobdiff - core/12_locale/12_locale.zprofile
12_locale: Only Linux seems to lowercase & transform the encoding
[ax-zsh.git] / core / 12_locale / 12_locale.zprofile
index 04d8a2a8ef9fec34afe236c30bfac32f7335e242..e6256eeba610a72c05205a4092431900a54cc71f 100644 (file)
@@ -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