Part of the EllisLab Network
   
 
Retriveing Rss results getting problem
Posted: 30 August 2007 02:55 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  81
Joined  06-25-2007

i am calling one function like this

------------code in controller ---------------
$this->load->library(’simplepie’);
$arr_data[’feed’] = new SimplePie();
$arr_data[’feed’]->set_feed_url(’http://images.apple.com/main/rss/hotnews/hotnews.rss’);
$arr_data[’feed’]->set_cache_location(’cache’);
$arr_data[’feed’]->init();
$arr_data[’feed’]->handle_content_type();
-------------end of code in controller ---------------

in view page i am calling like this
------------------

<?php
if ($feed->data)
{
$max = $feed->get_item_quantity(20);
for ($x = 0; $x < $max; $x++)
{
$item = $feed->get_item($x);
echo $item->get_title();
echo htmlentities($item->get_description());

}
}

?>
problem is .............i am getting results with unknown characters......in description content as shown below.........

iTunes customers in the UK can now purchase and download hit television programming from ABC Studios, the Disney Channel, MTV, Nickelodeon, and Paramount Comedy for £1.89 an episode. The programming includes such shows as the Emmy Award-winning series “Lost,” “Desperate Housewives,” “Grey’s Anatomy,” and “Ugly Betty,” as well as locally-produced UK series, including MTV’s “Barrio 19,” Nickelodeon’s “Genie in the House,” and Paramount Comedy’s “Comedy Blue.”

please help me
thx

 Signature 

Masssss............
Please always help to others....at any time

Profile
 
 
Posted: 30 August 2007 04:53 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
RankRank
Total Posts:  133
Joined  07-17-2007

try setting a meta tag in your view to indicate the browser it should render in UTF-8 charset, like so:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

this usually salves the strange characters problem

 Signature 

Computers are incredibly fast, accurate and stupid. Human beings are incredibly slow, inaccurate and brilliant. Together they are powerful beyond imagination.

A. Einstein

Profile
 
 
Posted: 31 August 2007 12:23 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  81
Joined  06-25-2007

snake

In header i changed from

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

to

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Its really great alpar...............Its working fine

Thanks a lot..............

 Signature 

Masssss............
Please always help to others....at any time

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 61072 Total Logged-in Users: 15
Total Topics: 73897 Total Anonymous Users: 2
Total Replies: 398567 Total Guests: 310
Total Posts: 472464    
Members ( View Memberlist )