I have a website writteng in greek.
<meta name="keywords" content="" /> can I use greek language in content or just in english?
If I can write them using greek chars, do I have to add anything to meta tag?
Thank you
You can use any character you want from the character set you are using. Just make sure that your web server send the correct character set headers in the HTTP request. You may also add a <meta> element specifying the charset, but it's not strictly necessary.
I use UTF-8 in these examples as I think it's a code charset and prefer to use it myself. It's on its way to take over as the standard charset on the web.
HTTP header which should be sent by the web server:
Content-Type: text/html; charset=utf-8
Optional <meta> element for your document:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Related
I have the language pack for Japanese characters installed onto my computer so I can practice but when I put it into an html file and uploaded it to the server that I'm using, it displays as this weird gibberish.
The encoding is in utf-8 but it still appears this way?
http://kotonii.com/katakana.html
You should check your server configuration. It does not have a "charset" in the "Content-type" header and in absence of this, the browser will use its own default charset (usually iso-8859-1, a.k.a. 'Latin1').
Your server has this:
Content-Type: text/html
It should be this, for your browser to decode it as utf-8:
Content-Type: text/html; charset=utf-8
You can also add this to the page's <head> section, it helps if you are viewing it in the browser as a local file (but shouldn't be a substitute for the HTTP header):
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
I'm new to learning HTML and learning about metadata in a webpage. It seems like people prefer you have to set the character set to support utf-8 and people are also saying have charset="text/html" so browsers know what kind of information they are receiving. How can I set both since it seems like both use the same attribute?
text/html is a media type, not a character set. The server can send a Content-Type: text/html; charset=utf-8 header to identify the content as HTML encoded as UTF-8. When you’re using a <meta> tag, though, the content is already known to be HTML and the only thing that matters is the charset, so HTML5 introduced the option to write <meta charset="utf-8"> as shorthand for <meta http-equiv="Content-Type" content="text/html; charset=utf-8">. (Older browsers also support this because people had a habit of forgetting quotes in the original.)
In short, if you’re using a <meta> tag, just write this:
<meta charset="utf-8">
and you’re done. The page is already HTML.
I have created web page using Chinese. When I view the page with Google chrome, all Chinese characters are corrupted. Do I have to add something in HTML page?
There are two ways to define the encoding of your page. You should include inside your <head> tags an encoding tag, two ways to do that follow below:
Short way:
<meta charset="utf-8">
Long way:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
You can have more details about the difference between these two ways in this question:
<meta charset="utf-8"> vs <meta http-equiv="Content-Type">
If you want to see a real example, take a look in the weibo.com source code at this line of code.
Make sure to use UTF-8 or a comparable encoding.
This can be made sure in the http headers:
Content-Type: text/html; charset=utf-8
use utf-8 character set otherwise it will all be code
remember <meta charset="utf-8"
Ensure you are using the UTF-8 character set
Even though i use the below meta tag to set the content-type and charset, i am not seeing the charset header in the firefox firebug debugger.
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Any help is appericiated.
The meta tag does not affect the HTTP headers sent. (Long ago, it was kind-of meant to do such things, but apart some forgotten experiments, it never did.) It specifies the encoding to be implied if HTTP headers do not specify the encoding; so it’s really not equivalent to an HTTP header (as the name ´http-equiv` suggests) but a replacement, surrogate, Ersatz for an HTTP header.
The way to set the HTTP headers depends on the server software and its settings.
But if the headers do not specify the encoding, then the meta tag takes effect. You ca check via the View → Encoding menu in Firefox which encoding is being applied.
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
It is how you set charset header for HTML files,there is nothing wrong.
Why would you use firebug to check the Charset? Just right click your mouse key and from the context menu select view page info and it will give you the page charset.
I have a email template, that has French copy. If I load this email template up in IE I receive square boxes where the accented characters are. How can I combat this? I assume it is down to encoding?
Ensure the HTML template has the correct meta tag in the header for Content-Type.
You did not specify if the encoding is Latin1, UTF-8 or other - you need to find out first in order to use the right value.
Here is what a UTF-8 meta tag would look like:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Just make sure that the actual encoding of the textfile (I assume it'll be either ISO-8859-1 or UTF-8) is in accordance with the meta tag defining the encoding in the beginning of the file. e.g.:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
see http://en.wikipedia.org/wiki/Character_encodings_in_HTML