Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

Linux 中調整顯示語系

Posted on 2025-10-302025-10-30 by Rico

升級到 Ubuntu 24 之後,Vim 顯示中文亂碼。
原因通常是「終端機編碼 / Vim 編碼設定不一致」,Ubuntu 22 → 24 預設 locale 可能被重置成 C 或 POSIX,不是 UTF-8。

🔍 排查步驟

1. 看系統 locale

locale

如果看到類似:

LANG=C
LC_ALL=

那就不是 UTF-8。

Ubuntu 24 預設應該是:

LANG=zh_TW.UTF-8

或至少是 en_US.UTF-8。


2. 修正 locale

如果缺中文 locale,先裝:

sudo apt update
sudo apt install language-pack-zh-hant

設定環境:

sudo update-locale LANG=zh_TW.UTF-8

登出再登入,或直接測:

export LANG=zh_TW.UTF-8
export LC_ALL=zh_TW.UTF-8

Recent Posts

  • Enable Logrotate for Dovecot in Docker: Prevent Huge Log Files and Disk Overflow
  • 在 Docker Dovecot 中啟用 Logrotate:避免 log 爆量、磁碟被塞滿的最佳做法
  • How to Choose Suricata RuleSets on OPNsense — Practical Guide & Best Recommendations
  • OPNsense Suricata 使用指南 — 規則(RuleSets)該怎麼選?最佳實務與推薦設定
  • Proxmox VE + Proxmox Backup Server Integration & Cross-Node Restore Guide

Recent Comments

No comments to show.

Archives

  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme