当前位置: 首页 > news >正文

Windows subsystem for Linux 汉字不显示

I installed ubuntu 26.04 subsystem, but it doesn't display chinese characters properly.

中国 became

''$'\344\270\255\345\233\275''.txt'

 

 

This issue occurs because the environment isn't correctly interpreting UTF-8 encoded characters, causing the shell to display the octal representation of the bytes (e.g., \344\270\255 for "中").

Since you are using a fresh Ubuntu 26.04 instance, the locale is likely set to a minimal configuration. Here is how to fix it:

1. Generate and Set the Locale

First, ensure that the language packs and UTF-8 locales are generated. Run these commands in your Ubuntu terminal:

Bash
 
# Update the package list
sudo apt update# Install language packs
sudo apt install language-pack-zh-hans# Generate the locale
sudo locale-gen zh_CN.UTF-8# Set the system-wide locale
sudo update-locale LANG=zh_CN.UTF-8

2. Configure Your Shell Environment

Even if the system locale is set, your current shell session might need a nudge. Add the following lines to your ~/.bashrc (or ~/.zshrc if you use Zsh):

Bash
 
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:zh
export LC_ALL=zh_CN.UTF-8

After saving the file, apply the changes by running:

source ~/.bashrc

 

这时系统被设置成了中文,如果不满意,可以改为en_US

# Generate the locale
sudo locale-gen en_US.UTF-8# Set the system-wide locale
sudo update-locale LANG=en_US.UTF-8

 

http://www.jsqmd.com/news/812500/

相关文章:

  • 2026年质量好的工具房压花机精选推荐公司 - 行业平台推荐
  • Claude Code 安装后如何配置 Taotoken 密钥与聚合端点实现稳定调用
  • 0401开源光刻机整机控制与量检测系统(A级 中期集中攻坚)1. 开源套刻精度核心原理
  • 创业沟通陷阱:从“一切顺利”到“坦诚求助”的工程化实践
  • 2026年Q2全国典当行核心技术能力拆解与标杆实践:四川典当行/四川房产典当行/四川房产抵押/四川房屋抵押/四川车辆抵押/选择指南 - 优质品牌商家
  • 2026年Q2全国化工泵品牌实力排行及对接指南:压滤机进料泵、地坑泵、多级液下泵、悬臂式液下泵、悬臂液下泵、料浆液下泵选择指南 - 优质品牌商家
  • Sphero智能球硬件拆解与动态控制优化方案
  • 路由守卫的常见案例使用方式
  • 电子产业生态的沉默基石:全球供应链中精密制造与人力价值再思考
  • 2026年热门生鲜店收银软件:选型指南与场景化优势解析
  • 2026年Q2广西研磨机采购指南:为何裕长鑫建机成为首选供应商? - 2026年企业推荐榜
  • 图片换背景底色怎么制作?一款微信小程序让你3步搞定
  • 开源图书管理系统OpenClaw-Book:基于Vue与Spring Boot的轻量级解决方案
  • 3步解锁百度网盘Mac版高速下载:逆向工程实践指南
  • PS2游戏二进制重编译:从MIPS到x86的静态分析与动态优化实践
  • 2026年梅花联轴器选型TOP5推荐:梅花联轴器、碳纤维联轴器、耐腐蚀螺丝、膜片联轴器、真空螺丝选择指南 - 优质品牌商家
  • 3分钟掌握Figma转JSON:设计师与开发者的终极协作指南
  • 半导体产业模式之争:IDM与代工在先进制程下的博弈与融合
  • 5分钟搞定VRoid Studio中文界面:汉化插件完全使用指南
  • QQ音乐加密音频格式解码技术方案与实践指南
  • Deep Agents:开箱即用的AI智能体框架,快速构建自主规划与执行应用
  • 反弹 shell 的工作原理是什么?
  • 大恒相机USB3驱动冲突排查:设备管理器可见但软件无法识别的深度解析
  • 2026清镇不压价奢侈品回收TOP5:清镇二手手表回收/清镇包包回收/清镇名表回收/清镇奢侈品回收/清镇白银回收/选择指南 - 优质品牌商家
  • VLC for Android:如何用开源技术重新定义你的移动观影体验?
  • ARM ERR<n>STATUS寄存器解析与错误处理实践
  • USGv6新规驱动IPv6单栈部署:从协议原理到实战测试的全面指南
  • 免费抠图软件一键抠图无水印有哪些?2026年最实用工具对比测试
  • 单目3D感知AI:低成本实现车载舱内智能交互的核心技术
  • 010、Park变换原理与推导