Html 无法在浏览器中显示希腊字母

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15438046/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 06:29:50  来源:igfitidea点击:

can't show greek letters in browser

htmlcssencodingcharacter-encodingmetadata

提问by Dchris

I am developing a website using html and css and i can't see greek letters.Instead of this,i only see symbols. i have the following line in my html file:

我正在使用 html 和 css 开发一个网站,但我看不到希腊字母。相反,我只能看到符号。我的 html 文件中有以下行:

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

I also tried:

我也试过:

<meta http-equiv="content-type" content="text/html;charset=windows-1253" />
<meta http-equiv="content-type" content="text/html;charset=ibm869" />
<meta http-equiv="content-type" content="text/html;charset=ibm737" />
<meta http-equiv="content-type" content="text/html;charset=iso-8859-7"/>
<meta http-equiv="content-type" content="text/html;charset=x-mac-greek"/>
<meta http-equiv="content-type" content="text/html;charset=x-EBCDIC-GreekModern "/>
<meta http-equiv="content-type" content="text/html;charset=x-EBCDIC-Greek "/>

Nothing worked! p.s. I tried this in Firefox and Internet Explorer

没有任何效果!ps 我在 Firefox 和 Internet Explorer 中尝试过

回答by John

As per your comment

根据你的评论

Open your file in Notepad, File -> Save As from the top menu, then there's a drop down in the save as dialogue where you can select character encoding. Make sure UTF-8 is chosen rather than ANSI

在记事本中打开您的文件,从顶部菜单中选择文件 -> 另存为,然后在另存为对话框中有一个下拉菜单,您可以在其中选择字符编码。确保选择 UTF-8 而不是 ANSI

Once the file has been saved as UTF-8 then you should have no problems adding Greek letters, (or Russian, Hebrew, Japanese or whatever)

将文件保存为 UTF-8 后,添加希腊字母(或俄语、希伯来语、日语或其他)应该没有问题

回答by Aaron Blenkush

Per the comments / answers here, you'll need to check to see what the encoding is set to. Best way would be to see exactly how the server is sending it by inspecting the Response Headers. You can do this with Developer Tools on most browsers.

根据此处的评论/答案,您需要检查编码设置为什么。最好的方法是通过检查响应头来确切地了解服务器是如何发送它的。您可以在大多数浏览器上使用开发人员工具执行此操作。

I just inspected the headers for this page using Chrome:

我刚刚使用 Chrome 检查了此页面的标题:

enter image description here

在此处输入图片说明

回答by Nick

I had the same problem while developing a page in greek. The problem wasn't the utf-8. I had to correct the CSS.

我在希腊语中开发页面时遇到了同样的问题。问题不在于 utf-8。我不得不更正 CSS。

Regards,

问候,

Nick

缺口