Learning programming
-
A Former User last edited by
What encoding? I didn't encode the Cyrillic letters - I just typed them in there.
They become question marks only when I try editing that shit (retype them anew) in a "page source" tab in my Opera. If I type them in in the Notepad, right there they look nice - while in those but one browsers it's "ßíäåX" and "àéàé" (I copypaste that from the source and page itself - just loaded, while there in the doc(s) they look perfectly Cyrillic as well as directly copypasted from there the very same in here - "ЯндеX coffeecup").
Well, and I ain't got no boxes. :norris:
-
Deleted User last edited by
Setting a charset shows correct title in browser!
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!-- charset must be set! --> <title>Янде Coffee Cup</title></head> <body> <button type="button" onclick="alert('Give Miiii Coffiieeeee!')">Do not disturb my Coffieeeeee!</button> </body> </html>
-
A Former User last edited by
What do these
meta
attributes do exactly?<!-- charset must be set! -->
Well, I haven't learned about this element yet, but so far they didn't include that in their example codes...
I wonder what?
Why is it that one browsers "corrupt" those Cyrillic while others do just fine with it?
Yesterday I thought of an idea to check the codes of some Russian sites/pages which are plenty and whose Cyrillic doesn't get "corrupt" in those "corrupting browsers" in that way... I'm up to that yet. :rolleyes: -
A Former User last edited by
Well, so far I've taken a look at two of such (Russian pages).
The first one's declaration heavily resembled non-5 HTML (so far as I can judge), the next one's looks more HTML5ish (well, it's still not it):!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
This site (page) does have a 'mixed' title too:
<title>Dubna.RU • Дубна.Рф • Прогноз погоды</title>
...So far I can't see any
meta-charset
there, but there's this:<link rel="stylesheet" type="text/css" href="/styles.css" />
The only "language" thing I can see so far is this
<script>
element (still in thehead
- last but two):<script type="text/javascript" src="http://apis.google.com/js/plusone.js"> {lang: 'ru'} </script>
So, so far I haven't found an html5 page with a 'mixed' title yet...
...ahm..:wait: -
Deleted User last edited by
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
tells the browser to use UTF-8 as charencoding to get all charcters in HTML correctly interpreted.Dependent of your OS and Texteditor with Russian language you can have UTF-8 or KOI8-R or ISO 8859-5 or Windows-1251
See
https://de.wikipedia.org/wiki/KOI8
https://de.wikipedia.org/wiki/Windows-1251
https://de.wikipedia.org/wiki/ISO_8859-5 -
A Former User last edited by
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
tells the browser to use UTF-8 as charencoding to get all charcters in HTML correctly interpreted.Well, are these attributes/values proper in HTML5?
And another question stays: why do certain browsers(version(s) of)
handle those/my pages when they do not contain anymeta
s at all? -
Deleted User last edited by
Well, are these attributes/values proper in HTML5?
The element META is allowed with attribute http-equv in HTML5.
See
http://www.w3.org/TR/html5/document-metadata.html
http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv-content-type
http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equivAnd another question stays: why do certain browsers (version(s) of) handle those/my pages when they do not contain any metas at all?
Some browsers do have a default fallback, if charencoding is missing. Some browsers guess which encoding it could be. On some servers the correct encoding is send by a HTTP header. On some servers the incorrect encoding is send by a HTTP header.
-
A Former User last edited by
Some browsers do have a default fallback, if charencoding is missing. Some browsers guess which encoding it could be.
But if I amend my htmls with that
charset
- will those "good" browsers do not mind it? Like"Gosh! Master added a 'charset' - let me break then!"
? -
Deleted User last edited by
will those "good" browsers do not mind it?
Well, they might mind or not.
You can trust me, i'm webdevoloper and have more or less bad experiences with browsers and websites over years
-
A Former User last edited by
will those "good" browsers do not mind it?
Well, they might mind or not.
Well... then I'll investigate some more Russian sites' codes first... :rolleyes:
You mind? -
A Former User last edited by
You know, Angie, lots of Russian sites seem to be written not in HTML5 - whether it's HTML4.01 or XHTML (once I noticed).
And well, I've just come across two sites in a row written in HTML5 and having a Cyrillic title - one of them even mixed (and the latter is not even Russian, but Google's localised page).
Well, both of them have thatmeta
: the former (Яндекс) has it "<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
", the Google one - "<meta content="text/html; charset=UTF-8" http-equiv="content-type">
".So now I'm gonna try creating a test doc with this head element.
-
A Former User last edited by
Angie, I added this line: "
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
"; now I'm having boxes there instead of letters(a new doc from one of those just by adding that)
.<abbr title="Add/edit→">➫</abbr>
You know what?
I just opened the code of this new one(with the boxes)
and rewrote *the boxes* here in Opera, applied: the page has got looking just fine!I don't know if it needs a messing with the fonts somehow...
-
Deleted User last edited by
For HTML it is irrelevant for char encoding if you have HTML5 or HTML 4.x or XHTML.
The problem with the "boxes" may be incorrect characters in HTML and wrong encoding (in HTML code or Server sent HTTP headers) or missng charcters in a used font for display in Opera.
But your texteditor should store the HTML file as UTF8!
Please show me a URL of such russian webpage which title is incorrect. I'll investigate.
-
A Former User last edited by
But your texteditor should store the HTML file as UTF8!
Should I check that out?
Please show me a URL of such russian webpage which title is incorrect. I'll investigate.
You meant "Russian"?
Well, I don't seem to be able to: the titles themselves of those Russian (and localised) [online] sites/pages are nothing but correct - while mine have never been published yet (I only shared.html
files in a group or two - you want that?). -
Deleted User last edited by
Yes, check if the content is stored as UTF. Which editor do you use? Notepad++?
No, its ok, if these pages are only local your own, you need not to show.
-
A Former User last edited by
Yes, check if the content is stored as UTF.
It wasn't.
I hadn't been advised on that, so I'd been leaving the default "ANSI" there. Now I tried resaving one of my oldest htmls changing that to "UTF8" - the doc overwrote itself successfully (I'll check that on one of the two "mixed-titled" later). -
A Former User last edited by
Yes, I resaved those two - but you know what?
The recent test one where I inserted the<meta>
, got boxes and then amended using my Opera('source code')
- appeared (seemed) alreadyUTF-8
now (means it was the only one for whose resaving my Windows already offered "UTF-8" as default - for others it did always seem "ANSI" being the default there). -
A Former User last edited by
Thank you, Angie, for your "UTF" advice!
I just opened of theUTF
-resaved documents in my Chrome: looks perfectly o'k!
Yeah - the other one too! :yes:
For you: -
Deleted User last edited by
Fine, now my reputation as female geek, HTML witch and IT professional grows more and more
The coffe is too cold, now. But next time after good help, please send me a coffee machine LOL