Forum Moderators: phranque

Message Too Old, No Replies

encoding wrong

         

Karabaja

9:56 pm on Aug 2, 2006 (gmt 0)

10+ Year Member



I am using rss2html script wich converts rss feed into html.
Some characters are displayed wrong on this pages created by the script.
Author of the script told me that script generates content in utf-8 and that I should set meta tag in html template that script uses to utf-8 and I did but it still displays wrong. His next reply was:

"What is happening is your web server is sending a "Content-Type:" HTTP header, which happens to be blank. A "Content-Type:" header overrides the same message in the HTML. Up at the very top of multivision.php before any thing is printed add the following line (s), this will send the correct header.

<?php
header("Content-Type: text/html; charset=UTF-8");
?>"

And I tried that but it didn't help. Do you have any ideas of what I should do to fix this. Other pages like plain html pages or vbulletin forum pages don't have any problems.
Pages have mixed content of english and french. The problem is only with the part that is in french. For example this is what I get for example:
G&#65533;rard Depardieu
instead of Gérard Depardieu

I am not sure this is issue with apache but I noticed some options in httpd.conf were change after I upgraded php to 5.0.4 so I supsected I could have something wrong or missing in apache config.

jdMorgan

3:11 pm on Aug 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Encoding problems are the worst... :(

That accented "e" in "Gerard" looks like UTF-16, not UTF-8, to me. You might want to try specifying UTF-16 in the Content-type header instead, and see if that changes anything.

Also use an online server headers checker or the "Live HTTP Headers" extension to Firefox to examine *all* of the headers that your server is sending with these pages. You may have multiple conflicting character set/encoding headers.

Jim

Karabaja

9:00 pm on Aug 3, 2006 (gmt 0)

10+ Year Member



Thx for the reply, I managed to sort it out. Seems that original rss feeds I was using had wrong encoding. I've setup few feeds using feed43.com service but since the site that content was taken from had no charset specified feed had default encoding set to utf-8.
I changed that on feed43 site and it is ok now.

jdMorgan

9:32 pm on Aug 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad you got it sorted!

Jim