IE8不渲染一些HTML名称实体 [英] IE8 is not rendering some of the HTML name entities

查看:152
本文介绍了IE8不渲染一些HTML名称实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些HTML名称实体未在IE8中呈现,而是可以看到未呈现的HTML实体!例如& scedil; & inodot;

Some HTML name entities are not rendering in IE8 and instead I can see the not rendered HTML entity! For example ş or ı.

我发现使用HTML号实体(例如ş 而不是& scedil; 。

I found a solution to use HTML number entities such as ş instead of ş.

我想知道是否有人知道这个问题的原因,如果有办法看到& scedil; & inodot; 或类似实体在IE8中正确?

I was wondering if anyone knows about the reason of this issue and if there is a way to see ş or ı or similar entities correctly in IE8?

这是我的代码在jsfiddle:(如果你复制这个代码到一个HTML文件,它不会在IE8渲染)

Here is my code on jsfiddle: (If you copy this code to a HTML file, it will not render in IE8)

http://jsfiddle.net/7uBrd/

<HTML lang="TR">
 <HEAD>
  <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> 
  <TITLE>test</TITLE>
 </HEAD>
 <BODY>
  <p>This is not working in IE8: afi&scedil;ler, e&scedil;yalar&inodot;, k&inodot; </p>
  <p> This is working: afi&;#351;ler, e&#351;yalar&#305;, k&#305; </p>    
  <p>This is Working as well: test&nbsp;test&ndash;</p>
 </BODY>
</HTML>


推荐答案

命名HTML实体的浏览器支持支持数字实体。毕竟,该数字是字符的Unicode代码点,而名称需要在浏览器的源代码中手动更新查找表。您提到的那些实体只是Internet Explorer从版本8(甚至版本9,不知道约10)不支持。

Browser support for named HTML entities has always been worse than support for numeric entities. After all, the number is the Unicode code point for the character while the name requires manual update of a lookup table in the browser's source code. Those entities you mention are just not supported by Internet Explorer as of version 8 (or even version 9, no idea about 10).

您已经有一个解决方法,但我建议你只需切换到UTF-8并完全避免实体(除了& amp; 和其他合理的例外)。

You already have a workaround but I recommend that you just switch to UTF-8 and avoid entities completely (save for &amp; and other reasonable exceptions).

这篇关于IE8不渲染一些HTML名称实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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