summaryrefslogtreecommitdiffstats
path: root/content/posts/WSL-Arch-Linux-ZSH输入中文乱码解决方法.md
diff options
context:
space:
mode:
authoryingyu5658 <i@yingyu5658.me>2025-12-13 08:33:08 +0800
committeryingyu5658 <i@yingyu5658.me>2025-12-13 08:33:08 +0800
commit1e5f8eb33bc41cb59faf059e83701152785cabea (patch)
tree45867273ac2178285be840764f7962d2b55556c6 /content/posts/WSL-Arch-Linux-ZSH输入中文乱码解决方法.md
downloadblog-1e5f8eb33bc41cb59faf059e83701152785cabea.tar.gz
blog-1e5f8eb33bc41cb59faf059e83701152785cabea.zip
Initial commit
Diffstat (limited to 'content/posts/WSL-Arch-Linux-ZSH输入中文乱码解决方法.md')
-rw-r--r--content/posts/WSL-Arch-Linux-ZSH输入中文乱码解决方法.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/content/posts/WSL-Arch-Linux-ZSH输入中文乱码解决方法.md b/content/posts/WSL-Arch-Linux-ZSH输入中文乱码解决方法.md
new file mode 100644
index 0000000..0e2aa27
--- /dev/null
+++ b/content/posts/WSL-Arch-Linux-ZSH输入中文乱码解决方法.md
@@ -0,0 +1,22 @@
+---
+abbrlink: 570074617
+categories:
+- 往昔
+date: "2025-04-29 10:31:26"
+description: 乱码是由于没有安装字体造成的,安装字体即可
+tags:
+- Linux
+title: WSL Arch Linux ZSH输入中文输入法乱码解决方法
+---
+
+没有进行配置的情况下输入中文,一般会显示<0xffffffff>,这是由于没有安装字体造成的。
+
+```bash
+sudo pacman -S noto-fonts-cjk # 安装中文字体
+sudo vi /etc/locale.gen # 取消注释 zh_CN.UTF-8
+sudo locale-gen # 生成语言环境
+echo "export LANG=zh_CN.UTF-8" >> ~/.zshrc # 设置默认中文环境
+source ~/.zshrc
+```
+
+source后,再次尝试输入中文,无异常。