termux里面安装的mobox中文显示乱码怎么解决?
Creado el: 6 de septiembre de 2025
Respondido usando GPT-5 Thinking por Chat01
Creado el: 6 de septiembre de 2025
Respondido usando GPT-5 Thinking por Chat01
termux里面安装的mobox中文显示乱码怎么解决?
看哪里“乱码”先分清:
根因:终端字体不含 CJK 或环境变量不是 UTF-8。
解决
font.ttf 放到 ~/.termux/,重启 Termux 即生效。(ask.csdn.net, my.oschina.net)bashecho 'export LANG=C.UTF-8' >> ~/.profile echo 'export LC_ALL=C.UTF-8' >> ~/.profile . ~/.profile
根因:容器里缺中文字体/locale 或字体缓存未刷新。Mobox 是在 Termux 上通过 Termux:X11 跑 Linux + Wine 的一套脚本/环境。(GitHub, XDA Developers)
解决(在 Mobox 的 Linux 容器里执行)
bash# 1) 字体与字体配置 sudo apt update sudo apt install -y fontconfig locales \ fonts-noto-cjk fonts-wqy-zenhei fonts-wqy-microhei # 2) 生成中文 locale(Ubuntu/Debian) sudo sed -i 's/^# *zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen sudo locale-gen sudo update-locale LANG=zh_CN.UTF-8 LC_CTYPE=zh_CN.UTF-8 # 3) 刷新字体缓存 fc-cache -fv
做完重启 Mobox/Termux:X11。若你之前跑过“汉化脚本”后菜单变方块,这通常也是缺 CJK 字体导致,按上面安装字体后即可恢复正常。(tieba.baidu.com)
根因:Wine 前缀里缺中文 Windows 字体。
解决(在容器里执行)
bash# 安装 winetricks 并一键装常用中文字体 sudo apt install -y winetricks cabextract winetricks -q cjkfonts # 或:winetricks -q allfonts # 确认 Wine 前缀路径(不设时默认 ~/.wine) echo "${WINEPREFIX:-$HOME/.wine}"
也可以把 simsun.ttc、msyh.ttc 等放进 $WINEPREFIX/drive_c/windows/Fonts/,再 fc-cache -fv。完成后重启对应程序即可。(Mobox 基于 Termux:X11 + Wine 跑应用,中文显示依赖 Wine 前缀里的字体。)(GitHub, XDA Developers)
~/.config/fontconfig/fonts.conf 增加 CJK 字体优先级通常也能治标(Noto CJK / 文泉驿)。(oryoy.com)如果你说下具体哪一步出现乱码(终端/图形界面/Wine 程序名),我可以把命令按你的环境精确到位。