Fetch json with non ASCI characters like #252;, chrome displays network displays correctly(使用 等非 ASCI 字符获取 json,chrome 正确显示网络显示)
问题描述
我在 chrome 开发工具中使用 fetch native.在 response.json() 中接收到作业的数据,但非 ascii 字符 ate 位显示正确.
I am using fetch native in chrome dev tools. In the response.json() the data of the job are received but non ascii characters ate bit displays correctly.
chrome 的网络标签在响应正文中正确显示字符.
The network tab of chrome shows the characters correctly in the response body.
我尝试设置不同的内容类型标题,UTF-8 和 ISO-8891-1.
I have tried to set different headers of content type, UTF-8 and ISO-8891-1.
如何才能看到chrome的开发工具如何正确显示字符?
How can.I see how dev tools of chrome displays correctly the characters?
推荐答案
终于解决了,我用的是native xhttpRequest
和这个native函数
I finally solved it, I used native xhttpRequest
and this native function
xhr.overrideMimeType("application/json;charset=iso-8859-1");
我从这里拿的:
在 Javascript 中显示重音字符
这篇关于使用 ü 等非 ASCI 字符获取 json,chrome 正确显示网络显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 ü 等非 ASCI 字符获取 json,chrome 正确显示网络显示


基础教程推荐
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01