Gokhan Posted September 11, 2014 Share Posted September 11, 2014 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 More sharing options...
Ingolme Posted September 11, 2014 Share Posted September 11, 2014 If you want to see why specifying the character set is important, try writing some Greek characters and change the charset to UTF-8. Link to comment Share on other sites More sharing options...
Gokhan Posted September 12, 2014 Author Share Posted September 12, 2014 (edited) 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 September 12, 2014 by Gokhan Link to comment Share on other sites More sharing options...
Ingolme Posted September 12, 2014 Share Posted September 12, 2014 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 More sharing options...
davej Posted September 12, 2014 Share Posted September 12, 2014 Yes, the meta tag value must match the encoding your text editor is using. UTF-8 is widely supported and handles most languages. http://en.wikipedia.org/wiki/UTF-8 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now