Powered By Blogger

Wednesday, February 19, 2014

@charset "utf-8"; why spcify in css style sheet

It tells the browser to read the css file as UTF-8. This is handy if you CSS contains unicode characters and not only ASCII.

Character sets are case-insensitive, so utf-8 is equally valid. [IANA Character Sets].

UTF-8 encodes each Unicode character as a variable number of 1 to 4 octets, where the number of octets depends on the integer value assigned to the Unicode character. It is an efficient encoding of Unicode documents that use mostly US-ASCII characters because it represents each character in the range U+0000 through U+007F as a single octet.

UTF-8 is the default encoding for XML and since 2010 has become the dominant character set on the Web.

No comments:

Post a Comment