oh-my-zsh Chinese Character Encoding Issues
11月 26, 2017
·
1 分钟阅读时长
·
105
字
·
-阅读
-评论
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 ~/.zshrcto make it take effect immediately. Enter Chinese characters again and you’ll find it’s fixed.

