首页 > 解决方案 > vue - axios - ISO-8859-1 需要帮助(字符集)

问题描述

请帮助 vue + axios + ISO-8859-1。我通过 axios 向 json 文件发出请求并得到响应:

服务器以 ISO 8895-1 编码发送它,我无法更改它。如何使用 axios 在 vue 组件中以不同的编码获得输出?

VueCharset

  mounted() {
    axios
      .get('http://example.com/status-json.xsl', {headers: {'Content-type': 'text/plain; charset=ISO-8859-1'}})
      .then(response => (this.info = response.data.icestats.source.title))
      .then(function (response) {console.log(response)});
  }, 

我尝试更改/删除等

{headers: {'Content-type': 'text/plain; charset=ISO-8859-1'}}

标签: vue.jsaxioscharacter-encodingcharset

解决方案


推荐阅读