W3C home > Mailing lists > Public > www-international@w3.org > January to March 2010

RE: For review: Character encodings in HTML and CSS

From: CE Whitehead <cewcathar@hotmail.com>
Date: Sun, 14 Feb 2010 17:37:11 -0500
Message-ID: <BLU109-W76563156BD869FC29B930B34B0@phx.gbl>
To: <xn--mlform-iua@xn--mlform-iua.no>, <ishida@w3.org>
CC: <www-international@w3.org>

Hi, Leif, R. I., all:


> Comments are being sought on this article prior to final release. Please send any comments to this list (www-international@w3.org). We expect to publish a final version in one to two weeks.

> See http://www.w3.org/International/tutorials/tutorial-char-enc/temp

From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> 
Date: Wed, 10 Feb 2010 07:09:09 +0100

> The document appears thin when it comes to CSS escapes. 

>  * The explanation of what an CSS escape is, is now located under the 
> heading "What are entities and NCRs?" 
> <http://www.w3.org/International/tutorials/tutorial-char-enc/temp#what>. 
> I think a separate header for CSS escapes would be better. Or, 
> alternatively, that the existing heading should be changed to say "What 
> are entities, NCRs and CSS escapes?". 
Hmm, entities and NCR's are types of escapes, and the information on escapes should all be together.
I think the reason that CSS is not singled out is because these escapes can be in CSS, HTML, or XML, and R. I. does not mention HTML or XML in the title.  Perhaps the title could be
"What are entities and NCRs?:  Escapes in HTML, XML, and CSS.:
But you are right, the CSS escapes seem to be a special case. 
>  * There should also be a CSS escape example, the same way that there 
> already are yellow colored examples of NCR and entities.
>  * (One of the) CSS examples could e.g. show what it means in practise 
> that the space character terminates the CSS escape, as this can be 
> highly confusing for authors. This can best be shown by having a CSS 
> selectors which contains only escaped letters, or a selector consisting 
> of 3 letters with the escaped one in the middle:

> .mål{} 

> becomes (note the space)

> .m\0000e5 l{} 

Thanks; having an example here seems to me a good idea as this is an area where I am still unsure (whereas I've used entites and NCR's in HTML a ton).

> (3) Specification of the encoding of an external CSS file: The text 
> currently says that 

>    ]]If your external CSS style sheet contains any non-ASCII text [ 
> snip ] you should use the @charset rule as the first thing on the page. 
> (It should not be used for CSS embedded in a document.)"[[

>    However, I think many authors are not aware that they may use HTTP 
> to signal the charset of CSS files as well. Therefore I think you 
> should mention this. (You already mentioned another alternative in that 
> context, namely to use the BOM. BOM has issues of support you say, but 
> HTTP work very well, AFAIK.)

I think R. Ishida did mention this--albeit briefly!  See:

"For external, linked CSS style sheets the precedence rules are:

HTTP Content-Type 
@charset rule 
link charset attribute "


R. I. hardly discusses the BOM for CSS either; he discusses the @charset rule
and how it might interact with the BOM (so that if you had a BOM you might not want an @charset declaration) . . . where does he really, in-depth, discuss the BOM as a way of declaring the character encoding for CSS pages?


> (4) The logics of using escapes in @style and <style> and stylesheets:
>   * I believe many web authors think they /have/ to use escapes e.g. in 
> CSS selectors. So I think that the document should say that they don't 
> have to - they can often type them directly - especially if CSS and 
> HTML are located in the same document ...

Hmm, it might not be explicit enogh; it's certainly implicit; for R. I. says:

"It is a good idea to always declare the encoding of external CSS style sheets if you have any non-ASCII text in your CSS file."

> (5) I believe that many authors are not aware that they may use 
> character escapes inside (many) HTML attributes. Hence I think a word 
> should be said about that the thing that this is in fact possible. (You 
> talk about the style attribute, but @style is - or may appear - as a 
> special case.
Perhaps.  But there is some mention of this too--it's pretty implicit in the section:

Do you think additional info about thie use of escapes inside attributes should be listed in "When to use escapes?"


(And thanks again very much to R.I. for this; I see that the HTML character entities are outdated and that I need to update all mine to unicode character entities;
Ooh I took my time to read that part; I did not want to.)


C. E. Whitehead
Received on Sunday, 14 February 2010 22:37:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 21 September 2016 22:37:31 UTC