Jump to content

charset attribute in <meta> tag


Gokhan

Recommended Posts

Hello everyone,

 

I am trying to figure out the use of charset attribute. However I couldn't find a good example. I used the charset value ISO_8859-7:1987, it is known as Greek and I expected to see my paragraphs written in Latin will be encoded different than it was written. However it is still encoded correctly. How can I see if it really works?

Link to comment
Share on other sites

If you want to see why specifying the character set is important, try writing some Greek characters and change the charset to UTF-8.

 

 

I tried what you said but it works correctly. I used the code below and I can see the Greek letters as it was written. What am I doing wrong?

<!DOCTYPE html><html><head><title>Example</title><meta charset="UTF-8"></head><body><p>Αποτελεί την πλέον επιτυχημένη ομάδα στην ιστορία του</p></body></html>

Also I tried the example shown in the link below, I changed the charset to UTF-16 and windows-1252 as advised and it still doesn't affect. Is there something unusual with my browsers?

 

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_script_charset

Edited by Gokhan
Link to comment
Share on other sites

In the W3Schools example changing the character set to ISO-8859-1 makes the greek characters render like this in Firefox: αβγδεζηθ

 

In your local examples, it depends on what character set the file was saved as using the text editor (it could ba ANSI, UTF-8 or something else) and what character set you're telling the browser the file uses.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...