Forum Moderators: phranque

Message Too Old, No Replies

Missing Charset Encoding

         

keyplyr

6:05 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For some reason my hosting server (apache) has stopped including the Charset Encoding in the HTTP Content-Type field. Neither of these work any longer via .htaccess:

AddDefaultCharset On
- or -
AddDefaultCharset ISO-8859-1
- or -
AddType 'text/html; charset=ISO-8859-1' html php

I believe they are adding support for PHP5, while continuing to support 4 and in the process have changed their server config. However, they are not answering my complaints (3 days now)

I know that I can add the META tag to the individual webpages, but I manage 4 sites with over 200 pages each - a chore.

I also see that Yahoo and Webmasterworld do not pass Charset Encoding in their HTTP header.
Question: What negatives result from the lack of this information to indexing bots and browsers?
(I get a fair amount of International traffic and use an on-site translator)

encyclo

6:38 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can also specify the charset with PHP if that is what you are using:

<?php header('Content-Type: text/html; charset=ISO-8859-1');?>

The trouble is, AddDefaultCharset is in the Apache core (not in a module), so in theory it should always be available...

Are the other directives in the .htaccess file functioning?

I believe the problem with not sending a charset is that the browser will display it with the default encoding as set in the browser preferences - which in not always the right one.

keyplyr

7:08 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>Are the other directives in the .htaccess file functioning?

Yes, it seems.

The thing that irritates me the most, besides my host's apathy, is I'm not getting a clean validation from W3C. It now says "This site 'tentatively' validates as..." then goes on to display a punitive yellow backgrounded "No Encoding found"

encyclo

7:16 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know that I can add the META tag to the individual webpages, but I manage 4 sites with over 200 pages each - a chore.

Ahh, that's when you realize the joys of global header includes!

I'm still looking into this because it's so weird. Has your host switched from Apache 1.3 to Apache 2.0 or something else major? Anyway, if my host messed with me for three days like that, I'd be already on the way elsewhere...

keyplyr

7:31 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Has your host switched from Apache 1.3 to Apache 2.0 or something else major?

No but they are adding PHP5 while keeping support for the existing PHP4 users; somehow causing all this. They do pull some screwball stunts from time to time, but over all they offer much more than any other comparable alternative, at least for my needs.

encyclo

12:22 am on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a couple of thoughts about this: is the problem affecting only files with the extension .php, or all
text/html
files? If it is to do with the PHP installation, it could be something to do with the AddType or AddHandler used for identifying PHP files - have you tried adding something like:

RemoveHandler .php 
RemoveType .php
AddHandler application/x-httpd-php .php
AddType text/html .php .htm .html
AddDefaultCharset On

(Do this in a test subdirectory first so you don't risk breaking everything!)

Are your host offering PHP5 on .php5 extensions only, or on all .php files unless you specify .php4?

keyplyr

1:04 am on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Thanks encyclo, charset encoding info is not showing in the HTTP Content-Type field of the server header, hence all files types are affected.

Are your host offering PHP5 on .php5 extensions only, or on all .php files unless you specify .php4?

I don't know. I use PHP everywhere, but never specified version. They all still work, so that's not really my concern :)