RE: For review: Character encodings in HTML and CSS

CE Whitehead, Mon, 15 Feb 2010 17:25:08 -0500:

>> However, it might also be a good thing to mention that Apache allows us 
>> to override [ AKA specify file by file] the encoding very simply by 
>> adding charset suffixes, as I explained here:
> 
>> http://lists.w3.org/Archives/Public/www-amaya/2010JanMar/0083.html
> Many thanks for this;
> I have saved this link for my reference.
> And now I have a question for you:  do I name the utf-8 version of my 
> file (for example)
> 
> index.html.utf8.html
> 
> or index.html.utf-8.html
> ?

This is something you can define yourself - in a '.htaccess' file or in 
the 'httpd-languages.conf' file. But the default from Apache's side is 
'utf8'. You have to test if this works on your server. In the 
'.htaccess' file or the 'httpd-languages.conf' file you must have this:

AddCharset UTF-8   .utf8

> Thanks again
> 
> (and if anyone can help me better understand when a server is going 
> to take my html pages with an html 4.01 document type declaration at 
> the top and serve these as unicode/utf-8,
> I would be interested in knowing this too).

If you follow the advice in R.I..'s text and add

AddType 'text/html; charset=UTF-8' .html

to where he says you can add it there, then any file with the suffix 
'.html' should be served as UTF-8 - then you may forget the AddCharset 
thing I explained above. Apache will anyhow not care about the doctype 
declaration.
-- 
leif halvard silli

Received on Monday, 15 February 2010 23:02:39 UTC