Click here to get back home

@charset rule

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
@charset rule =?ISO-8859-1?Q?Fran=E7ois_Patt 10-06-2007
|--> Re: @charset rule André Gillibert10-06-2007
---> Re: @charset rule Harlan Messinge...10-06-2007
  ---> Re: @charset rule =?ISO-8859-1?Q?...10-06-2007
  | |--> Re: @charset rule Harlan Messinge...10-06-2007
  | `--> Re: @charset rule Jukka K. Korpel...10-06-2007
  `--> Re: @charset rule =?ISO-8859-1?Q?...10-07-2007
Posted by =?ISO-8859-1?Q?Fran=E7ois_Patt on October 6, 2007, 9:31 am
Please log in for more thread options
Bonjour,

I am wondering why the @charset rule is not working for me.

I put at the early beginning of my index.css file:

@charset "utf-8";

no line before....

and in every html file:

<link rel="STYLESHEET" href="index.css">

Everything is OK for all style definitions made in the index.css
(background, fonts style, size, and so on....

Only the charset definition is not working.... Browsers always return
ISO8859-1!!!

If I add this line in html files:

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >

it works....

Boring!

What's wrong?

Thank you
--
François Patte
Université Paris 5 - Paris

Posted by André Gillibert on October 6, 2007, 9:40 am
Please log in for more thread options
François Patte wrote:

> Bonjour,
>
> I am wondering why the @charset rule is not working for me.
>
> I put at the early beginning of my index.css file:
>
> @charset "utf-8";
>
> no line before....
>
> and in every html file:
>
> <link rel="STYLESHEET" href="index.css">
>
> Everything is OK for all style definitions made in the index.css
> (background, fonts style, size, and so on....
>
> Only the charset definition is not working.... Browsers always return
> ISO8859-1!!!
>

You didn't specified what "returns ISO8859-1" means.
I guess that you may not have understood that the charset directive
defines the charset of the CSS file, not the HTML file.

--
If you've a question that doesn't belong to Usenet, contact me at

Posted by Lars Eighner on October 6, 2007, 9:48 am
Please log in for more thread options
In our last episode,
the lovely and talented François Patte
broadcast on comp.infosystems.www.authoring.html:

> Bonjour,

> I am wondering why the @charset rule is not working for me.

> I put at the early beginning of my index.css file:

> @charset "utf-8";

This only declares the charset of the *stylesheet.* It is not clear that
any browser honors it.

> no line before....

> and in every html file:

><link rel="STYLESHEET" href="index.css">

> Everything is OK for all style definitions made in the index.css
> (background, fonts style, size, and so on....

> Only the charset definition is not working.... Browsers always return
> ISO8859-1!!!

So far you have done nothing that declare the charset of the html
document. What is being identified as iso-8859-1? If it is the html
document, the browsers are probably right. That is the default for html.

> If I add this line in html files:

> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >

> it works....

> Boring!

> What's wrong?

Nothing in the stylesheet should be expected to affect the content of an
html document. You certainly cannot declare the html charset in a
stylesheet. I do not know whether the @charset in a stylesheet is effective
in any browser, but if it is, it should apply only to the stylesheet itself.

> Thank you
--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 472 days to go.
What do you do when you're debranded?

Posted by Harlan Messinger on October 6, 2007, 9:48 am
Please log in for more thread options
François Patte wrote:
> Bonjour,
>
> I am wondering why the @charset rule is not working for me.
>
> I put at the early beginning of my index.css file:
>
> @charset "utf-8";
>
> no line before....
>
> and in every html file:
>
> <link rel="STYLESHEET" href="index.css">
>
> Everything is OK for all style definitions made in the index.css
> (background, fonts style, size, and so on....
>
> Only the charset definition is not working.... Browsers always return
> ISO8859-1!!!

The @charset rule specifies only the encoding of the stylesheet. It
doesn't specify the encoding of the web page that links to the
stylesheet. It can't--the page's content can be completely processed and
the document model completely built in memory by the time the stylesheet
gets to the browser.

Posted by =?ISO-8859-1?Q?Fran=E7ois_Patt on October 6, 2007, 10:18 am
Please log in for more thread options
Harlan Messinger a écrit :
> François Patte wrote:
>> Bonjour,
>>
>> I am wondering why the @charset rule is not working for me.
>>
>> I put at the early beginning of my index.css file:
>>
>> @charset "utf-8";
>>
>> no line before....
>>
>> and in every html file:
>>
>> <link rel="STYLESHEET" href="index.css">
>>
>> Everything is OK for all style definitions made in the index.css
>> (background, fonts style, size, and so on....
>>
>> Only the charset definition is not working.... Browsers always return
>> ISO8859-1!!!
>
> The @charset rule specifies only the encoding of the stylesheet. It
> doesn't specify the encoding of the web page that links to the
> stylesheet. It can't--the page's content can be completely processed and
> the document model completely built in memory by the time the stylesheet
> gets to the browser.

Thanks to all. I did not understand that this declaration was limited to
the css file only...

And now I don't understand why it is necessary to declare the charset of
the css file.

--
François Patte
Université Paris 5 - Paris

Similar ThreadsPosted
Charset Mismatch November 7, 2004, 10:13 am
ISO CHARSET PROBLEM November 8, 2005, 10:13 am
Server handling of Charset August 1, 2004, 1:15 pm
charset=unknown-8bit October 18, 2005, 4:33 pm
About charset setting and replacing July 14, 2006, 6:29 am
Setting Correct Charset? June 29, 2007, 10:24 am
Tech guy still insists the problem is charset October 29, 2004, 4:29 am
Netscape Composer: How to set charset for a page? November 4, 2004, 6:11 am
browsers don't follow the charset specification March 10, 2005, 10:19 am
Determining Charset used by system or software January 19, 2006, 2:03 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap