小编Mat*_*mes的帖子

如何从 axios 获取 utf-8 中的值在 node.js 中接收 iso-8859-1

我有以下代码:

const notifications = await axios.get(url)
const ctype = notifications.headers["content-type"];
Run Code Online (Sandbox Code Playgroud)

ctype 接收“text/json; charset=iso-8859-1”

我的字符串是这样的:“'Ol?Matheus,est?pendente。',”

如何从 iso-8859-1 解码到 utf-8 而不会出现这些错误?

谢谢

utf-8 iso-8859-1 character-encoding node.js axios

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

axios ×1

character-encoding ×1

iso-8859-1 ×1

node.js ×1

utf-8 ×1