带口音的E不能正确显示 [英] E with accent doesn't show correctly

查看:148
本文介绍了带口音的E不能正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网页上,顶部中间的文字(«Ce网站互联网»)包含E,其中带有在我的电脑上显示为问号的重音。



尽管事实上我的头标中有meta charset =UTF-8,当用Notepad ++打开时,包含文本的PHP文件显示为UTF-8。



接下来发生了什么?

解决方案

浏览器在无法理解正在阅读的数字时显示。
UTF-8是自同步的。与其他多字节字符编码不同,您始终知道UTF-8在哪里。如果你看到一个192-247的数字,你就知道你在一个多字节序列的开头。如果你看到128-191,你就知道你在一个中间。没有任何遗漏第一个数字并篡改文本其余部分的危险。
这意味着在UTF-8中,序列191和224之后永远不会自然发生,因此浏览器不知道如何处理它,并显示 。


$

 < meta charset =UTF-8> 
< meta http-equiv =Content-typecontent =text / html; charset = UTF-8>

请参阅: http://coding.smashingmagazine.com/2012/06/06/all-about-unicode-utf8-character-sets/


On my page, the text in the top middle (« Ce site Internet. ») contains E with accents which on my computer appear as question marks.

This is despite the fact that I have meta charset="UTF-8" in my head tag and the PHP file containing the text appears as UTF-8 when opened with Notepad++.

What's going on then?

解决方案

The browser displays these when it can’t make sense of the numbers it is reading. UTF-8 is self-synchronzising. Unlike other multi-byte character encodings, you always know where you are with UTF-8. If you see a number 192-247, you know you are at the beginning of a multi-byte sequence. If you see 128-191 you know you are in the middle of one. There’s no danger of missing the first number and garbling the rest of the text. This means that in UTF-8, the sequence 191 followed by 224 will never occur naturally, so the browser doesn’t know what to do with it and displays �� instead.

Use the following in your head tag:

<meta charset="UTF-8">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">

See: http://coding.smashingmagazine.com/2012/06/06/all-about-unicode-utf8-character-sets/

这篇关于带口音的E不能正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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