3 replies [Last post]
sawatdee
Offline
newbie
Last seen: 13 years 25 weeks ago
Joined: 2008-03-21
Posts: 8
Points: 0

@charset can only appear in a style sheet file, not in the html document itself. Can someone give me an example of how and why you would use @charset instead of specifying the charset in the content-type of the html file? I am very interested in i18n and l10n and I can't see any advantage to using it.

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 1 day ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Its not instead

Its not instead of.

@charset is used to describe the charset of the stylesheet file.
content-type is one of the methods available for describing the charset used in the webpage.

sawatdee
Offline
newbie
Last seen: 13 years 25 weeks ago
Joined: 2008-03-21
Posts: 8
Points: 0

Okay, that makes sense and

Okay, that makes sense and it is what I would have assumed at first. Then the description at devguru is incorrect which says, "The @charset at-rule allows you to designate a character set be used with an HTML document."
http://www.devguru.com/technologies/css2/8039.asp

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 1 day ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Yes, its