dzygners' forums
You have never visited, or are not logged in.
Not logged in [Login - Register]

Printable Version | Send to Friend
Subscribe | Add to Favorites
Author Subject: [question] Charset on Apache 1.3.?
St.Per
Member






136 Posts
Location . SWE
Status: Offline

posted on 8.19.2004 at 18:46 Reply With Quote
[question] Charset on Apache 1.3.?

Hi,
I tried to validate a file yeasterday as xhtml at http://validator.w3.org/
The validator said: "No Character Encoding Found! Falling back to UTF-8"
I have an apache server of my own (1.3.?). What should I do, if I don't want to write the charset in a meta-tag?

View User's Profile View All Posts By User U2U St.Per
hzr
Moderator






1701 Posts
Location . localhost
Status: Offline

posted on 8.19.2004 at 19:02 Reply With Quote
In your Apache config, add the following line
code:
AddDefaultCharset   encoding    
where encoding is the encoding of your choice, e.g. ISO-8859-1.




hzr
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U hzr
St.Per
Member






136 Posts
Location . SWE
Status: Offline

posted on 8.20.2004 at 09:00 Reply With Quote
Thanks HZR
View User's Profile View All Posts By User U2U St.Per
jimdrake
flash guru






385 Posts
Location . Bristol, UK
Status: Offline

posted on 8.20.2004 at 12:30 Reply With Quote
the validator isn't reading anything directly from your files properties, nor does it matter what settings you have on your server.

the validator simply wants a meta tag in the header to identify what type of files it is. it's one of the requirments to be an xhtml document.

code:
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />  


you can change your charset to whatever you like.





View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U jimdrake
St.Per
Member






136 Posts
Location . SWE
Status: Offline

posted on 8.20.2004 at 13:07 Reply With Quote
My site tentatively validated as XHTML 1.0 Strict before I changed my server configuration. Now it's valid, thanks to David. So having a meta tag can't be a requirment. Maybe it's an option.

Anyway.. It works fine now, thanks for all answers.

View User's Profile View All Posts By User U2U St.Per
hzr
Moderator






1701 Posts
Location . localhost
Status: Offline

posted on 8.20.2004 at 13:35 Reply With Quote
It's certainly not a requirment to include a meta element that specifies the character encoding in an XHTML document. It's just a substitute for a real HTTP header.




hzr
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U hzr
Mark
scripter






1599 Posts
Location . Netherlands
Status: Offline

posted on 8.20.2004 at 17:31 Reply With Quote
Jimdrake, may I correct you on that? Apache sends the encoding as a header, which the validator (as well as any other user agent) uses to display the document. The meta element isn't necessary, you should use a correct header.

And you should use UTF-8, of course




| Mark
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Mark
jimdrake
flash guru






385 Posts
Location . Bristol, UK
Status: Offline

posted on 8.20.2004 at 18:52 Reply With Quote
my mistake

when i had files that didn't validate i put that meta tag in and it worked fine.

now i just keep that as my template for all my xhtml files.....





View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U jimdrake
Mark
scripter






1599 Posts
Location . Netherlands
Status: Offline

posted on 8.21.2004 at 13:14 Reply With Quote
If you don't send a header you'll need the meta element. The header is advisable though.




| Mark
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Mark
Quick Reply [ Show All Smilies ] Not logged in [Login - Register]



© 2002 - 2005 dzygn.com
Powered by XMB v1.5 Beta :: Blue Moon
Processed in 0.3954861 seconds, 35 queries