HTML 页面标题中的西班牙语字符
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14936291/
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
Spanish Characters in HTML Page Title
提问by user580950
My HTML code for Page title looks like this
我的页面标题的 HTML 代码如下所示
<title>Telefonía</title>
When i check it on browser the SPanish character is not displayed exactly like the above
当我在浏览器上检查它时,西班牙语字符与上面的显示不完全一样
It shows page title as below
它显示页面标题如下
I tried using & iacute;AND **&# 237; ** but it doesnt work in PAGE TITLE
我尝试使用& iacute; 和** 237; ** 但它在 PAGE TITLE 中不起作用
Here is my website url http://tinyurl.com/agdsqffi checked all the special codes but it doesnt work
这是我的网站网址http://tinyurl.com/agdsqff我检查了所有特殊代码但它不起作用
采纳答案by test
Try writing
尝试写作
í
í
instead. These are HTML escape characters. Here you can find a whole list http://www.theukwebdesigncompany.com/articles/entity-escape-characters.php
反而。这些是 HTML 转义字符。在这里你可以找到一个完整的列表http://www.theukwebdesigncompany.com/articles/entity-escape-characters.php
回答by Vucko
This works.
这有效。
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Telefonía</title>
</head>
回答by Jorge Eduardo
Put this in your <head>
:
把它放在你的<head>
:
<meta charset="UTF-8">
and if you want change your title dynamically in you .js put:
如果你想在你的 .js 中动态改变你的标题:
document.title="telefonía";
回答by Jukka K. Korpela
The element <title>Telefonía</title>
works just fine, provided that the document is saved in UTF-8 encoding (which is the encoding declared in an HTTP header sent by the server – no meta
tag inside the document can override that).
如果<title>Telefonía</title>
文档以 UTF-8 编码保存(这是在服务器发送的 HTTP 标头中声明的编码 -meta
文档中没有标签可以覆盖它),该元素就可以正常工作。
You seem to be changing the content of your pagetrying various ways that cannot work, such as <title>Telefonía</title>
and <title>Telefoniacute;a</title>
. If you use an entity reference, you should write <title>Telefonía</title>
. But there is no need for that: using the character as such is cleaner and simpler
您似乎正在尝试各种无效的方式更改页面内容,例如<title>Telefonía</title>
和<title>Telefoniacute;a</title>
。如果使用实体引用,则应编写<title>Telefonía</title>
. 但没有必要:使用这样的角色更干净、更简单
回答by Niel de Vries
See http://www.ascii.cl/htmlcodes.htmto check how you should encode special characters.
请参阅http://www.ascii.cl/htmlcodes.htm以检查应如何编码特殊字符。
In this case it would be í
or Í
在这种情况下,它将是í
或Í
回答by Salvatorelab
You have to check two things:
你必须检查两件事:
- Your file encoding. Yes, your HTML file. You have to save it as UTF-8 and then write "í" or whatever character you need.
Your
<meta>
tag. It should look like:<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- 您的文件编码。是的,您的 HTML 文件。您必须将其保存为 UTF-8,然后写入“í”或您需要的任何字符。
你的
<meta>
标签。它应该看起来像:<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Un saludo!
加油!
回答by scrblnrd3
<p>Telefonía</p>
is the hex code for it.
í works as well
http://jsfiddle.net/PDCvw/EDIT
It appears to work for me in the title. A link is http://shodor.org/~amalani/acute.htmlYou have the code
是它的十六进制代码。í 也
能正常工作http://jsfiddle.net/PDCvw/编辑
它在标题中似乎对我有用
。链接是http://shodor.org/~amalani/acute.html你有代码
<title>Telefon&iacute;a</title>
but what you need is Telefonía
但你需要的是 Telefonía
Telefonía
西班牙电信