RSS feeds in utf-8 bug

Locked
kauselot
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 159
Joined: Thu Sep 15, 2005 1:15 am

RSS feeds in utf-8 bug

Post by kauselot » Thu May 29, 2008 9:04 pm

we been having truble with garbage characters in my utf-8 feed - found out, that this is PHP error as html_entity_decode doesn't work for utf-8 ( php version is 5.2.6.)

So I created this workaround - but iso encoding in conversion should be changed to encoding that covers local characters.

in rss.php

Change:
$item_title = html_entity_decode( $item_title );

to
$item_title = mb_convert_encoding($item_title, "ISO-8859-2", $rss->encoding);
$item_title = html_entity_decode( $item_title );
$item_title = mb_convert_encoding($item_title, $rss->encoding, "ISO-8859-2");


and
$item_description = html_entity_decode( $item_description );

to

$item_description = mb_convert_encoding($item_description, "ISO-8859-2", $rss->encoding);
$item_description = html_entity_decode( $item_description );
$item_description = mb_convert_encoding($item_description, $rss->encoding, "ISO-8859-2");
Wanna know something Joomla? Hit the Joogpot! http://joogpot.eu
The LanternFish - translations manager for Joomla http://joogpot.eu/lanternfish

lucfit
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Oct 08, 2008 2:26 pm

Re: RSS feeds in utf-8 bug

Post by lucfit » Wed Oct 29, 2008 12:42 am

I there,

I don't know if this is the same issue. I cannot have the html parsed when parsing rss feeds into my joomla's content.

I've tried both Joomla 1.0.x. and 1.5.x on different servers with different components (this affect the core rss news feeds as well...) with different htaccess and php.ini configurations.

I've also tried different charsets with no results. Might you have any suggestion?

Thank you in advance.

Regards.

Lucfit

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: RSS feeds in utf-8 bug

Post by infograf768 » Wed Oct 29, 2008 5:30 pm

Joomla 1.5.x should display in utf8 ALL correctly formatted feeds whatever their original charset.

This is not the case for 1.0 who can natively take only care of utf8 and iso-8559-1 feeds.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

lucfit
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Oct 08, 2008 2:26 pm

Re: RSS feeds in utf-8 bug

Post by lucfit » Wed Oct 29, 2008 9:00 pm

Thanks,

I discovered what is causing my issue. This happens when I run joomla 1.5 on php5. No problems with php4. Unfortunately this requires not to use some components specifically designed to run with php5. I will try to find whether somebody else is facing this issue but it is not easy to find useful infos on this.

Thank you so much.

Lucfit

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: RSS feeds in utf-8 bug

Post by infograf768 » Fri Oct 31, 2008 2:46 pm

lucfit wrote:Thanks,

I discovered what is causing my issue. This happens when I run joomla 1.5 on php5. No problems with php4. Unfortunately this requires not to use some components specifically designed to run with php5. I will try to find whether somebody else is facing this issue but it is not easy to find useful infos on this.

Thank you so much.

Lucfit
Hmm...
Which version of PHP5 do you use?
Which version of Joomla 1.5 ?
Please also paste here a rss feed link which you have problems with, the link itself not a link to your site.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

lucfit
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Oct 08, 2008 2:26 pm

Re: RSS feeds in utf-8 bug

Post by lucfit » Fri Oct 31, 2008 4:00 pm

infograf768 wrote:
lucfit wrote:Thanks,

I discovered what is causing my issue. This happens when I run joomla 1.5 on php5. No problems with php4. Unfortunately this requires not to use some components specifically designed to run with php5. I will try to find whether somebody else is facing this issue but it is not easy to find useful infos on this.

Thank you so much.

Lucfit
Hmm...
Which version of PHP5 do you use?
Which version of Joomla 1.5 ?
Please also paste here a rss feed link which you have problems with, the link itself not a link to your site.

I'm running Joomla 1.5.7. The php version is php 5.2.5

I discovered that the system could smoothly hold both php 4 and 5 but it can only parse feeds with no losses when running on php4.

I'm so required to go to cpanel, select the php4, importing the feeds, then I'm free to select php5 again. This is not so handy nor useful to run a cronjob.

This happens with many components including the core joomla feeds. May this be related with a Simplepie bug?

I don't know.

e.g. of a feed: http://www.jobisjob.co.uk/rss?what=accounting

Thank you for your support.

Lucfit

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: RSS feeds in utf-8 bug

Post by infograf768 » Fri Oct 31, 2008 5:20 pm

Your feed works OK here.
J! 1.5.7
PHP 5.2.4

Maybe this is a setting of your php which prevents the feed from being retrieved.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

lucfit
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Oct 08, 2008 2:26 pm

Re: RSS feeds in utf-8 bug

Post by lucfit » Fri Oct 31, 2008 10:42 pm

I think so but still trying to understand which setting.

My hosting provider is not very supportive.

Anyway...thank you again for your interest.

Lucfit

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: RSS feeds in utf-8 bug

Post by infograf768 » Sat Nov 01, 2008 9:26 am

Look at your php settings for
allow_url_fopen

if it is off, it could be that setting.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Locked

Return to “Joomla! 1.0.x_Q&T”