Greek fonts issue - html

So this is my page: http://www.mysecretathens.gr/kulte_test/coming_soon.html and the greek fonts wont display, why is that?
I use Open Sans, greek script and I've put an html iso tag in the beginning, but still no Greek characters.
<html lang="el">

You are not telling your page to use UTF-8. The best way is to send an HTTP header.
Content-Type: text/html; charset=utf-8
The alternative is to let the webpage say what its encoding is
<meta charset='utf-8'>
Note that Chrome correctly guesses it. The first way is preferred since it keeps your application more DRY since you already have to choose an encoding on the server.

Related

Setting two charsets? utf-8 and text/html

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.

Use umlauts in UTF-8 coded HTML-files with firefox

<h1>Wörterbuch</h1>
This is a very simple (generated by Zotero) html file and it is UTF-8 coded.
But firefox is not able to handle it correct.
When viewing the source of the opened html file in firefox it looks like that.
<h1>Wörterbuch</h1>
My last touch of HTML is from the beginning of the 90's. This file is UTF-8 so firefox should know itself how to handle the ö their. But it doesn't so I need something in the header, right?
What information does firefox need here?
This work well with Opera.
Make sure your HTTP server is sending the correct HTTP header to identify the encoding of the document:
Content-Type: text/html; charset=utf-8
As a fallback, add the <meta> tag to the document's <head>:
<meta charset="utf-8">

Czech diacritic on HTML

I'm trying to make some text in czech, but I can't success :-/
Web is http://esn.zcu.cz/world/
formate of the file and in meta is iso-8859-2 which should allow czech chars
Your webpage has <meta charset="charset=utf-8"> and yet it isn't in UTF-8. Firefox interpreted it as ISO-8859-1, which makes vowels like éóí look okay, but then č you typed is being displayed as è.
Solution? You can fix the meta tag, but seriously, it's 21st century, you really should use UTF-8 everywhere. Convert the page to UTF-8, remove <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> and you'll be fine.
Note: your HTTP server returns this: text/html; charset=ISO-8859-1

HTML5 Encoding & Cyrillic

Something that made me curious - supposedly the default character encoding in HTML5 is UTF-8. However if I have a plain simple HTML file with an HTML5 doctype like the code below, I get:
"hello" in Russian: "ЗдраÑтвуйте"
In Chrome 33+, Safari 6, IE11, etc.
<!DOCTYPE html>
<html>
<head></head>
<body>
<p>"hello" in Russian is "здраствуйте"</p>
</body>
</html>
What gives? Shouldn't the browser utilize the UTF-8 unicode standard and display the text correctly? I'm using Coda which is set to save html files with UTF-8 encoding by default so that's not the problem.
The text data in the example is UTF-8 encoded text misinterpreted as window-1252 encoded. The reason is that the encoding has not been specified and browsers are forced to make a guess. To fix this, specify the encoding; see the W3C page Character encodings. Two simple ways that work independently of server settings, as long as the server does not send wrong encoding information in HTTP headers:
1) Save the file as UTF-8 with BOM (there is probably an option for this in your authoring program.
2) Add the following tag into the head part:
<meta charset=utf-8>
There is no single default encoding specified for HTML5. On the contrary, browsers are expected to make guesses when no encoding has been declared. This is a fairly complex process, described in 8.2.2.2 Determining the character encoding.
If you want to be sure which charset will be used by browser you must have in your page head
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
otherwise you are at the mercy of local settings and browser automation.

accented letters are not displayed correctly on the server, even if the encoding is correct

i wrote some html with utf-8 charset.
in the head of the html there is also a
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
everything works fine in local, but when i upload files to the server, i see all my letters
àèìòù etc
distorted.
anybody know how could it be the problem? is possible that the server force a charset that isn't utf-8?
thanks a lot
Try saving the actual file with utf-8 encoding. That did the trick for me.
I use PHPStorm as editor: File->File Encoding->utf-8
Actually the META tag is not all you need for correct UTF-8 encoding. Your server might still send the page as Content-Type: text/html; charset=ISO-8859-1 in the header of the page.
You can check the headers e.g. with the Live HTTP Headers Firefox add-on.
There is a lot of secret sauce with UTF-8 encoding and making it work, you might want to go through this page (UTF-8: The Secret of Character Encoding) which explains everything you need to know and gives you advice on how to solve encoding problems.
To answer your question: Yes it is possible to force the server to use UTF-8, e.g. by using the PHP headers() function like so:
header('Content-Type:text/html; charset=UTF-8');