html - 解码特殊字符 "ì"

标签 html json html-escape-characters

我有一个带有特定字符(即 ì)的 json 文件;

我有我的服务:

   $http({
        url: jsonUrl,                   
        method: "GET"
        }).success(function (data) { // data is an array that contains a list of elements (firstname,lastname,email)
            .....

字符ì以这种形式出现�!!!

我能做什么?? 谢谢

最佳答案

如果您使用的是 PHP,则可以像这样设置 header (显然只需选择一个,最好是数据本身的编码类型):

header('Content-Type: text/html; charset=UTF-8');
header('Content-Type: text/html; charset=iso-8859-1');

对于其他语言,它是需要传递给 header 的相同字符串,但是这将完成。

关于html - 解码特殊字符 "ì",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23698214/

相关文章:

javascript - 通过调整 dropzone.js 压缩图像

jquery - 如何对表单进行实时验证?

html - 如何标记阶梯/绘图

javascript - 使用 $http 请求的 AngularJS 单元测试永远不会触发 .then() 回调

javascript - angularjs 如何在html中转义 “${variable}”?

PHP打印带有多个单引号的字符串

javascript - 忽略空格的字符串的 Jest 相等匹配器

html - Bootstrap 导航栏上的图像突出显示在菜单栏上方和下方

javascript - 如何使用图像作为vue粒子?

javascript - 使用push函数在json文件中添加变量值