oh-my-zsh Chinese Character Encoding Issues

This article introduces the Chinese character encoding issues in oh-my-zsh, including the advantages, implementation details, and relevant resources. These steps can help improve efficiency when dealing with oh-my-zsh Chinese character encoding problems.

Nov 26, 2017 · 1 min read · 105 Words · -Views -Comments · Programming
Linux 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

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.

oh-my-zsh

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:

  1. vi ~/.zshrc
  2. Add the following two lines at the end:
export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8
  1. source ~/.zshrc to make it take effect immediately. Enter Chinese characters again and you’ll find it’s fixed.
Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover