温馨提示×

postman在debian中文乱码

小樊
40
2026-09-26 00:16:06
栏目: 智能运维

在 Debian 上使用 Postman 出现中文乱码,通常有以下几种原因和对应解决办法:


一、系统缺少中文字体(最常见)

Postman 基于 Electron(Chromium),如果系统没有中文字体,就会显示方块或乱码。

解决方式

安装中文字体:

sudo apt update
sudo apt install fonts-wqy-zenhei fonts-wqy-microhei

或者更全一点:

sudo apt install fonts-noto-cjk

安装后重启 Postman。


二、系统未设置中文环境(可选)

如果你希望整个系统支持中文:

sudo apt install locales
sudo dpkg-reconfigure locales

勾选:

zh_CN.UTF-8

并设置默认语言。

然后:

export LANG=zh_CN.UTF-8

⚠️ 这一步不是必须的,Postman 只要字体正确一般就能正常显示。


三、Postman 启动方式问题

如果你是通过 snap 安装的 Postman,有时字体访问受限。

建议改用官方版本

  1. 卸载 snap 版(如有):
sudo snap remove postman
  1. 从官网下载 Linux 版: https://www.postman.com/downloads/

  2. 解压并运行:

tar -xvf Postman-linux-x64-*.tar.gz
./Postman/Postman

四、响应内容本身编码问题

如果是接口返回中文乱码(不是界面乱码):

  • 确保接口返回:
Content-Type: application/json; charset=utf-8
  • Postman 中:
    • 查看 Body → Pretty
    • 不要手动改编码

五、快速自查清单 ✅

  • [ ] 已安装 fonts-noto-cjk 或文泉驿字体
  • [ ] 重启了 Postman
  • [ ] 不是 snap 版本(或已配置字体权限)
  • [ ] 接口返回 UTF-8

如果你愿意,可以告诉我:

  • Debian 版本(如 11 / 12)
  • Postman 安装方式(snap / deb / 官网)
  • 乱码是界面还是返回内容

我可以给你更精确的方案。

0 踩