Skip to content

Commit b5b146e

Browse files
committed
fix: resolve **Locale** issue where the host lacks en_US.UTF-8 but use another UTF-8 locale.
release `[email protected]` fixed #39
1 parent 6cedfe2 commit b5b146e

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
- override to `TERM=xterm-256color` when original is 'TERM=xterm' for default colorful compatibility
1313

1414

15+
16+
17+
- fix: resolve **Locale** issue where the host lacks `en_US.UTF-8` but use another UTF-8 locale. `jovial.plugin` will no longer change the locale in such cases.
18+
19+
1520
<br />
1621

1722

jovial.plugin.zsh

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
1+
2+
#
3+
# ########## Version ##########
4+
#
5+
6+
export JOVIAL_PLUGIN_VERSION='1.2.1'
7+
8+
19
#
2-
# Locale
3-
# utf-8 to display emoji
10+
# ########## Locale ##########
411
#
12+
# make sure utf-8 to display emoji and kaomoji (arrow of prompt by default `(๑˃̵ᴗ˂̵)و`)
13+
#
14+
# Check LC_ALL, LC_CTYPE, and LANG in order.
15+
# If none contains "UTF-8", set LC_ALL to en_US.UTF-8
16+
#
17+
18+
if [[ -n ${LC_ALL} ]]; then
19+
if [[ "${LC_ALL}" != *"UTF-8" ]]; then
20+
export LC_ALL=en_US.UTF-8
21+
fi
22+
elif [[ -n ${LC_CTYPE} ]]; then
23+
if [[ "${LC_CTYPE}" != *"UTF-8" ]]; then
24+
export LC_CTYPE=en_US.UTF-8
25+
fi
26+
elif [[ "${LANG}" != *"UTF-8" ]]; then
27+
export LANG=en_US.UTF-8
28+
fi
529

6-
export LC_CTYPE=en_US.UTF-8
7-
export LC_ALL=en_US.UTF-8
8-
export JOVIAL_PLUGIN_VERSION='1.2.0'
930

1031
#
1132
# ########## Aliases ##########

0 commit comments

Comments
 (0)