某些UTF-8字符不会显示在浏览器上 [英] Some UTF-8 characters do not show up on browser

查看:105
本文介绍了某些UTF-8字符不会显示在浏览器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些UTF-8字符,如UTF-8等同于C2 96(连字符)。在浏览器上,它显示为(带有00 96的utf框)。而不是 - (连字符)。这种行为的任何原因?我们如何纠正这一点?



http://stuffofinterest.com/misc/utf8.php?s=128 (请参阅代码的这个URL)



我发现这可以用html实体处理。有没有办法显示这个没有转换成html实体?

解决方案

我怀疑这是因为U + 0080和包括U + 009F是控制字符。我仍然有点惊讶,它们在HTML中直接编码时显示的不同于使用实体,但基本上您不应该使用它们来开始。 U + 0096不是真的连字号,它是开始守卫区。



请参阅 U + 0080-U + 00FF代码图表了解更多信息。基本上,尽量避免控制字符...


Some UTF-8 characters like the UTF-8 equivalent of C2 96 (hyphen). On the browser it displays it as (utf box with 00 96). And not as '-'(hyphen). Any reasons for this behavior? How do we correct this?

http://stuffofinterest.com/misc/utf8.php?s=128 (Refer this URL for the codes)

I found that this can be handled with html entities. Is there any way to display this without converting to html entities?

解决方案

I suspect this is because the characters between U+0080 and U+009F inclusive are control characters. I'm still slightly surprised that they show differently when encoded directly in the HTML than using entities, but basically you shouldn't be using them to start with. U+0096 isn't really "hyphen", it's "start of guarded area".

See the U+0080-U+00FF code chart for more information. Basically, try to avoid control characters...

这篇关于某些UTF-8字符不会显示在浏览器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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