I've recently encountered this problem: when I'm setting the lang=
attribute for the <html>
tag to ro
, all the diacritics on the page are changed to the Cedilla-type characters.
Normal diacritics screenshot(șțȘȚ):
Cedilla-type characters(şţŞŢ)
In the source, they are written as normal diacritics (pic1).
Now, the real problem is this:
Google Chrome:
<html>
-> text is like in pic2 - Cedilla-type diacritics<html lang="ro">
-> again, text is like in pic2 - Cedilla-type diacritics<html lang="en">
-> text is normal, like in pic1
Mozilla Firefox:
<html>
-> text is normal - pic1<html lang="ro">
-> text is like in pic2 - Cedilla-type diacritics<html lang="en">
-> text is normal, like in pic1
And two demos of the main cases:
h2 {
font-family: 'Open Sans';
margin: 0;
}
<html lang="ro">
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans&subset=latin-ext" rel="stylesheet">
</head>
<body>
<h2>Diacritics: ș, ț, Ș, Ț</h2>
</body>
</html>
h2 {
font-family: 'Open Sans';
margin: 0;
}
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans&subset=latin-ext" rel="stylesheet">
</head>
<body>
<h2>Diacritics: ș, ț, Ș, Ț</h2>
</body>
</html>
So, is there any way to keep the lang="ro"
attribute, but have the normal diacritics(like in pic1)?
Thank you!
** Update, forgot to mention: Romanian diacritics are the normal ones - not the ones with cedilla.
-webkit-locale: "ro"
to the html element; when I overwrite that with"en"
explicitly, it displays as you want. I have no idea however what else this might affect; and I can’t find something comparable in Firefox on a quick glance.-webkit-locale: "en"
. But would that affect the SEO in any way? I mean, the site will be in romanian, when Google will try to index it, won't he take that CSS property and sayThis is in english!
?lang
attribute on the html element in place - especially in regard to search engines. Specifyinghtml { -webkit-locale: "en"; }
in your stylesheet somewhere should be enough to overwrite it. And I doubt that takes preference over the language specified in the HTML.