0

有没有办法将动态创建的 IFRAME 的字符集设置为UTF-7?我尝试了以下但失败了:-(

document.getElementById('test').contentWindow.document.body.innerHTML = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-7\"></head><body></body></html>";

IFRAME 页面仍然是 UTF-8 :-( (使用 Firefox)

4

2 回答 2

2

UTF-7 在网络世界中一直被认为是危险的,而在其他开发世界中几乎完全没用。

有些浏览器从不支持它(例如 Chrome)。

链接:http ://scarybeastsecurity.blogspot.fr/2010/07/firefox-fixes-css-based-cross-origin.html

于 2012-06-10T09:43:55.750 回答
0

HTML5 规范要求符合标准的浏览器不得支持 UTF-7:

用户代理不得支持 CESU-8、UTF-7、BOCU-1 和 SCSU 编码。

来自http://dev.w3.org/html5/spec/parsing.html#determining-the-character-encoding

于 2012-06-10T10:30:36.440 回答