Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-11 09:43:51

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Character Encoding mismatch!

I get this when validating a TP site hosted on TextDrive, anyone able to please tell me what it means or how to correct it.

Character Encoding mismatch!
The character encoding specified in the HTTP header (utf-8) is different from the value in the <meta> element (iso-8859-1). I will use the value from the HTTP header (utf-8) for this validation.

Thank you, Lee.

Offline

#2 2006-07-11 17:18:32

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Character Encoding mismatch!

It means that your server is sending a different character encoding header from the meta content-type in your markup. An encoding sent via the HTTP header will always take precedence over a meta element. Browsers use the encoding the server sets in the http header first. If nothing is set, it uses the encoding indicated by the meta tag.

There are two ways to fix this: 1) Make your server send an ISO 8859-1 encoding (or none at all) or 2) Save your files as UTF-8 and change your meta element accordingly.

UTF-8 is really a better option but if you really need iso-8859-1 (and all your site pages will be using that character set) you can change the header Apache sends by putting

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AddDefaultCharset iso-8859-1

in your htaccess file. (I believe AllowOverrides needs to be enabled).


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#3 2006-07-11 17:30:06

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Character Encoding mismatch!

Textpattern itself sends a utf-8 header when it displays a page, so changing the Apache setting wouldn’t make a difference.

The validator is warning you that your content is being sent as utf-8, but you’ve used a different encoding in a meta element in your page. It is a good idea to use utf-8, and it supports everything in iso-8859-1 anyway.

Offline

#4 2006-07-11 18:18:14

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: Character Encoding mismatch!

Many thanks for the clear explanation.

Offline

#5 2006-07-11 19:18:17

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Character Encoding mismatch!

Textpattern itself sends a utf-8 header when it displays a page, so changing the Apache setting wouldn’t make a difference.

Does Textpattern modify the HTTP headers sent?


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#6 2006-07-11 19:45:19

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Character Encoding mismatch!

When Textpattern fetches any page, it sends it with a utf-8 header

header("Content-type: text/html; charset=utf-8");

so the server’s default is not taken into account. If you really wanted to, you could override it by sending a second header from your page itself, but there’s not many reasons why you’d want to bother.

Offline

#7 2006-07-11 19:59:22

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Character Encoding mismatch!

I agree, UTF-8/16 will pretty much cover it. Might be nice to have that configurable in admin panel though (like the utf-8 option for e-mail) for them as prefers something else.


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#8 2006-07-26 12:41:11

vanderkerkoff
Member
Registered: 2005-05-26
Posts: 45

Re: Character Encoding mismatch!

I know one time when I want to change the Content-Type

My file_downloads section, my spider I’m using to crawl the site is having a fit over the pdf files, they’re coming down as octet instead of pdf, how do I change that guys for the file_download section??

Cant find any help anywhere to this problem, I’d be really grateful for any assistance.

vander

Offline

#9 2006-07-26 12:52:55

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Character Encoding mismatch!

Do NOT crosspost your problems.

Especially since it is totally offtopic here.

Offline

Board footer

Powered by FluxBB