特殊字符未按预期显示 [英] Special character not displaying as expected

查看:88
本文介绍了特殊字符未按预期显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下简单的HTML页面:

I have the following simple HTML page:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
    <div>
        méywe
    </div>
</body>
</html>

在Chrome或Firefox中显示它时(我没有测试其他浏览器),我看到以下内容:

When displaying it in Chrome or Firefox (I did not test other browsers), I see the following:

m ywe

我想念什么? html文件以UTF-8编码保存.服务器是Apache.我的机器是Windows 7专业版.文本编辑器是UltraEdit.

What did I miss? The html file is saved in UTF-8 encoding. The server is Apache. My machine is Windows 7 pro. The text editor is UltraEdit.

谢谢!

更新

最初,我使用UltraEdit编辑此html文件,但出现了问题.基于 cmbuckley 的输入和Notepad ++的安装(根据 Heatmanofurioso 的建议),我考虑了文件可能以某种方式损坏的可能性(即使它看起来不错).以及UltraEdit和记事本).所以我用utf-8编码的记事本保存了文件.仍然看到了问题(可能是由于缓存???).然后,我使用UltraEdit再次保存了它.在浏览器中查看页面,问题消失了.

Initially, I used UltraEdit for editing this html file and I got the problem. Based on cmbuckley's input and install of Notepad++ (from Heatmanofurioso's suggestion), I thought about the possibility of my file being corrupt somehow (even though it looks fine in both UltraEdit and Notepad). So I saved my file with Notepad in utf-8 encoding. Still saw the problem (maybe due to cache???). Then I used UltraEdit to save it again. See the page in the browser and the problem is gone.

经验教训

如果这是您的工具,请使用两个文本编辑器,如果发现无法解释的问题,请尝试使用另一个文本编辑器.即使您每天都使用一种工具,但没有哪一种工具是完美的.就我而言,Notepad ++修复了我的文件中的utf8问题,UltraEdit失败了.

Have two text editors if that that is your tool, and try the different one if you see unexplainable problem. No tool is perfect, even though you use one everyday. In my case, Notepad++ fixed the utf8 issue with my file that UltraEdit somehow failed.

感谢人们的帮助!

推荐答案

1-替换

<meta charset="utf-8">

使用

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

2-检查您的HTML编辑器的编码是否为UTF8.通常,此选项可以在程序顶部的选项卡上找到,就像在Notepad ++中一样.

2 - Check if your HTML Editor's encoding is in UTF8. Usually this option is found on the tabs on the top of the program, like in Notepad++.

3-检查您的浏览器是否与您的字体兼容,是否以某种方式导入了字体.或者尝试添加一个CSS,以将您的字体设置为默认的/通常被接受的字体,例如

3 - Check if your browser is compatible with your font, if you're somehow importing a font. Or try and add a css to set your fonts to a default/generally accepted one like

body
{
    font-family: "Times New Roman", Times, serif;
}

希望它会有所帮助:)

这篇关于特殊字符未按预期显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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