encoding problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

encoding problem

Post by raghavan20 »

Code: Select all

Kiran Desai's <a href="http://www.bookdepository.co.uk/WEBSITE/WWW/WEBPAGES/showbook.php?id=0241143489">The Inheritance of Loss</a> has won this year's <a href="http://www.themanbookerprize.com/" target="_blank">Man Booker Prize</a>.
Actual URL
You can see the above quote in 'The Editor's Corner' section. Now the problem is, there appears to be a question mark after the word 'Loss' and this seems to be an encoding problem.

If I change the encoding in the browser to Western European it is fine but when I try to do it from webpage like

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
it does not work.

I am referring to character encoding here

Can anybody tell me why is this problem happening or can anybody give the exact code for Western-European used by IE?

Thanks for any help.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Your

Code: Select all

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

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Note the case of Content-Type.. (the declaration at present is being ignored).
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

that is still not working!

see here
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Looking at it I cannot see what is wrong. Case doesn't seem to be important. One thing which is confusing is the fact that the content type does not seem to be recognised, not just in IE but also in Firefox. Look at the content type of this page and it is also
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> which works.

What is the "bad" character being inserted (It's also occuring if you follow the link) ?. It seems to be coming from wherever you get the information. What is your "editor" saving as (mine defaults to utf-8 at the moment which can cause problems if I',m not using utf-8 ) ?

Sorry I can't direct you you to the proper answer.
Last edited by CoderGoblin on Thu Oct 12, 2006 3:00 am, edited 1 time in total.
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post by Rovas »

I have the same problem and I find out the server encode

Code: Select all

&nbsp;
as unicode character when I upload a page on the server. So Ihad to remove it and I had to change in all place that it appeared.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Rovas wrote:I have the same problem and I find out the server encode

Code: Select all

&nbsp;
as unicode character when I upload a page on the server. So Ihad to remove it and I had to change in all place that it appeared.
can you tell me &nbsp; appears as which character?
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post by Rovas »

Code: Select all

Â
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Rovas wrote:

Code: Select all

Â
so are you saying utf-8 encoding misinterprets certain character? what encoding do you suggest, I prefer western-european but the Content-Type meta tag does not seem to work.
Post Reply