IE8中没有正确从JSONP文件中读取特殊字符 [英] Special characters are not being read from a JSONP file correctly in IE8

查看:397
本文介绍了IE8中没有正确从JSONP文件中读取特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上一个问题我问,但专门为IE浏览器,因为我给了除IE之外的所有东西的作品。所以这个问题特别针对IE:



如何通过脚本读取JavaScript文件时使用字符集元素?



我有一个JSON文件,其中包含字符,在IE浏览器中使用< script charset =Cp1252... (它适用于所有其他浏览器)的HTML页面上,然后获得以下字符

解决方案

Internet Explorer要求 charset Windows-1252





对于 charset 属性,这应该是一个更普遍适用的值 - HTML5定义了该值应该是个案 - 在 IANA字符集注册表中不区分大小写的名称或别名:

名称:windows-1252 
MIBenum:2252
来源:微软(http://www.iana.org/assignments) / charset-reg / windows-1252)
别名:无

我知道Firefox也支持这个值,作为CP1252的同义词,规范建议其他浏览器也应该这样。


Same problem as a previous question I asked but specifically for IE, since the answer I gave works in everything except IE. So this question is specifically for IE:

How can I set the charset to be used when reading a javascript file via a script element in IE?

I have a JSON file with a character in it and when I include the file on to my HTML page with <script charset="Cp1252" ... (which works in every other browser) on IE, then I get the following character .

解决方案

Internet Explorer requires that the value for charset is Windows-1252.

This should be a more universally compatible value for the charset attribute - HTML5 defines that the value should be a case-insensitive match of a name or alias in the IANA Character Sets Registry:

Name: windows-1252
MIBenum: 2252
Source: Microsoft  (http://www.iana.org/assignments/charset-reg/windows-1252) 
Alias: None

I know that Firefox supports this value too, as a synonym for CP1252, the specification suggests that other browsers should too.

这篇关于IE8中没有正确从JSONP文件中读取特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆