charset on css

D

dorayme

I see "@charset "iso-8859-1";" at the top of some external css style sheets.
Is this important? It seems not to be essential? Please.

dorayme
 
E

Edwin van der Vaart

dorayme said:
I see "@charset "iso-8859-1";" at the top of some external css style sheets.
Could you give us some links ot those external style sheet files with a
charset?
Is this important? It seems not to be essential? Please.
It isn't essential and non-important.
 
D

dorayme

From: Edwin van der Vaart said:
Organization: Cyberspace can be like a black hole. Stuff gets sucked in, never
seen again.
Newsgroups: alt.html
Date: Sat, 19 Mar 2005 16:10:06 GMT
Subject: Re: charset on css

Could you give us some links ot those external style sheet files with a
charset?

It isn't essential and non-important.

Yes, I saw it on a css that commanded my respect at least!
http://webhost.bridgew.edu/etribou/layouts/skidoo/css/base.css for
http://webhost.bridgew.edu/etribou/layouts/skidoo/index.html

Just wondering why he put it there. It is at the top of all or most of the
css sheets he uses.


dorayme
 
E

Edwin van der Vaart

Toby said:
Perhaps he doesn't have access to specify the charset in the HTTP header
(where it belongs).
Suppose he doesn't have access to specify the charset in the http
header. Then he have to specify the charset on every html page.

My question is where can I find the http header file if I want to
specify the charset?
If I google for it, Google find header files for c, c+, c++, gcc, etc.
but not http header files.
 
T

Toby Inkster

Edwin said:
My question is where can I find the http header file if I want to
specify the charset?

There is no "header file". The HTTP headers are some lines sent by the
server to the client (and vice versa, but those are not relevant in this
context) before they send the requested file.

They include various status information and meta-data about the file
that's about to be sent.

If your page is being dynamically generated using a scripting language,
then you can generally influence the HTTP headers from within the script.

For example, in Perl you can do this:

#!/usr/bin/perl
print "Content-Type: text/html; charset=utf-8\n";
print "X-Custom-Header-1: foobar\n\n";

Or in PHP:

<?php
header('Content-Type: text/html; charset=utf-8');
header('X-Custom-Header-1: foobar')
?>

Or in ASP:

<%
Response.ContentType = "text/html"
Response.Charset = "utf-8"
Response.AddHeader "X-Custom-Header-1", "foobar"
%>

If you are using static files, then setting HTTP headers will require
manipulating the server's settings.

For example, in Apache you can use ".htaccess" config files to set headers:

Header set Content-Type text/html;charset=utf-8
Header set X-Custom-Header-1 foobar

Or instead:

Header set X-Custom-Header-1 foobar
AddType text/html .html
AddCharset utf-8 .utf8

and then a file with the name "myfile.html.utf8" will be served with the
same headers as my earlier examples.

Other servers will use other methods.
 
E

Edwin van der Vaart

Toby said:
There is no "header file". The HTTP headers are some lines sent by the
server to the client (and vice versa, but those are not relevant in this
context) before they send the requested file.

They include various status information and meta-data about the file
that's about to be sent.

If your page is being dynamically generated using a scripting language,
then you can generally influence the HTTP headers from within the script.

For example, in Perl you can do this:

#!/usr/bin/perl
print "Content-Type: text/html; charset=utf-8\n";
print "X-Custom-Header-1: foobar\n\n";

Or in PHP:

<?php
header('Content-Type: text/html; charset=utf-8');
header('X-Custom-Header-1: foobar')
?>

Or in ASP:

<%
Response.ContentType = "text/html"
Response.Charset = "utf-8"
Response.AddHeader "X-Custom-Header-1", "foobar"
%>

If you are using static files, then setting HTTP headers will require
manipulating the server's settings.

For example, in Apache you can use ".htaccess" config files to set headers:

Header set Content-Type text/html;charset=utf-8
Header set X-Custom-Header-1 foobar

Or instead:

Header set X-Custom-Header-1 foobar
AddType text/html .html
AddCharset utf-8 .utf8

and then a file with the name "myfile.html.utf8" will be served with the
same headers as my earlier examples.

Other servers will use other methods.
Thanx for the info.
I'll play with those examples.
 
D

dorayme

From: Toby Inkster said:
Newsgroups: alt.html
Date: Sun, 20 Mar 2005 13:14:46 +0000
Subject: Re: charset on css


Perhaps he doesn't have access to specify the charset in the HTTP header
(where it belongs).


I feared there would be a reason I did not understand properly! Not your
fault of course, just me not on top of this stuff. If you have time to
explain simply, I would greatly appreciate it. Please do not feel obliged.
In the meantime, I am gathering this charset reference is not needed
normally at the head of external css sheets.

dorayme
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top