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

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

问题描述

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

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 (请参阅此网址的代码)

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

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

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

推荐答案

我怀疑这是因为U + 0080和U + 009F(含)都是控制字符。我还是有点惊讶,他们显示不同的直接编码在HTML比使用实体,但基本上你不应该使用它们开始。 U + 0096不是真的连字符,它是守卫区的开始。

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".

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

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

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

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