温馨提示×

ubuntu postman为何乱码

小樊
37
2026-09-16 03:28:42
栏目: 智能运维

Ubuntu 上使用 Postman 出现乱码,通常不是 Postman 本身的 bug,而是系统字体、编码、或环境配置问题。下面按常见原因给你排查思路和解决办法:


一、最常见原因:系统缺少中文字体

Postman 在 Linux 下默认依赖系统字体,如果 Ubuntu 没有安装中文字体,就会显示方块或乱码。

✅ 解决方法

安装中文字体:

sudo apt update
sudo apt install fonts-noto-cjk
sudo apt install fonts-wqy-zenhei

安装后重启 Postman:

postman &

二、Postman 是通过 Snap 安装的(常见坑)

Snap 版 Postman 对字体和系统的访问有限,容易乱码。

✅ 建议改用官方版本

  1. 卸载 Snap 版:
sudo snap remove postman
  1. 到官网下载: https://www.postman.com/downloads/

  2. 解压并运行:

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

三、响应内容本身编码问题(不是 Postman 乱码)

如果界面正常,但返回数据显示乱码

检查点

  • 接口是否返回 UTF-8
  • Response Header 中是否有:
Content-Type: application/json; charset=utf-8

解决方法

  • 如果是 GBK:
    • Postman 目前不支持手动切换编码
    • 可在代码层转换(如 Python / Java)

四、系统语言环境不是 UTF-8

检查:

locale

如果不是 UTF-8

sudo apt install locales
sudo dpkg-reconfigure locales

选择 en_US.UTF-8zh_CN.UTF-8


五、Electron / GTK 渲染问题(少见)

尝试启动参数:

./Postman/Postman --disable-gpu

快速判断你的情况

你可以告诉我:

  1. 乱码出现在哪里(界面 / 返回数据)
  2. Postman 安装方式(Snap / 官网 / apt)
  3. Ubuntu 版本

我可以直接给你精确解决方案。

0