oh-my-zsh Chinese Character Encoding Issues
·
1 min read
zsh is a powerful shell, but its configuration is too complex for many people, causing them to hesitate. Until one day, a master developer created a project that makes it easy to get started - that’s
oh my zsh
. To learn more about it, visit the official repository.
After installing oh-my-zsh, I found that Chinese filenames would display as garbled characters. This is definitely a character encoding issue. After some research, here’s the solution:
vi ~/.zshrc
- Add the following two lines at the end:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
source ~/.zshrc
to make it take effect immediately. Enter Chinese characters again and you’ll find it’s fixed.