![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
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!!! |
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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. |
#4
| |||
| |||
|
|
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. |
#5
| |||
| |||
|
|
Scripsit François Patte: I did not understand that this declaration was limited to the css file only... That's not surprising; virtually all people get very confused with charset issues when they start working with them, but we can learn to keep the confusion at a manageable level. And now I don't understand why it is necessary to declare the charset of the css file. Mostly it isn't. You normally use just ASCII characters there, and then the charset mostly does not matter. It matters if you use, say, a font name containing non-ASCII characters, like body { font-family: "François", sans-serif; } (just assuming that you expect a font called "François" to exist somewhere). People have used e.g. font names containing Japanese characters. If this still puzzles you, c.i.w.a.stylesheets would be the right group to ask about CSS issues. |
#6
| |||
| |||
|
|
And now I don't understand why it is necessary to declare the charset of the css file. |
#7
| |||
| |||
|
|
On Sat, 6 Oct 2007, François Patte wrote: And now I don't understand why it is necessary to declare the charset of the css file. It is necessary when you want to include some special, non-ASCII characters - perhaps in comments or a byte order mark. http://www.unics.uni-hannover.de/nhtcapri/bom.css |
#8
| |||
| |||
|
|
On Sat, 6 Oct 2007, François Patte wrote: And now I don't understand why it is necessary to declare the charset of the css file. It is necessary when you want to include some special, non-ASCII characters [...] |
![]() |
| Thread Tools | |
| Display Modes | |
| |