Jump to content

freeflow

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

freeflow's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks a lot for your replies! I guess I'll have to leave it the way it is for now
  2. I have used htmlentities in other parts of my website to solve this problem, but I don't know how to implement it in the rss feed. A few days ago the feed didn't work with any browser (Opera/Safari) I used. Today they seem to work with Opera + the mobile version, but not with Safari. Which server do you mean? The Feed server or mine?
  3. This is the encoding: <?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> An example of what is being shown incorrectly (German): Ein schweres Erdbeben der Stärke 7,6 in Costa Rica hat eine Tsunamiwarnung ausgelöst. Laut der US-Erdbebenwarte USGS hatte das Beben eine Stärke von 7,6. Sein Zentrum lag demnach etwa zehn Kilometer östlich der Stadt Hojancha im Nordwesten des mittelamerikanischen Landes. Wrong Stärke ausgelöst östlich
  4. Hi everyone. I need some help to change the following code so it uses htmlentities to convert the text from the feeds. The news feeds are in German and some of the letters don't appear correctly in the browser. How do I change the code to make it work? <? $var = @$_GET['z'] ; $var2 = @$_GET['q'] ; echo "<h4> Yahoo! News - $var2</h4>"; $feed_url = "http://$var"; class RSSParser { var $insideitem = false; var $tag = ""; var $title = ""; var $description = ""; var $link = ""; function startElement($parser, $tagName, $attrs) { if ($this->insideitem) { $this->tag = $tagName; } elseif ($tagName == "ITEM") { $this->insideitem = true; } } function endElement($parser, $tagName) { if ($tagName == "ITEM") { print " <b>" . $this->title . "</b> <div class=\"text\">" . $this->description . "<br /><a href=\"" . $this->link . "\" target=\"_blank\"></a></div><br />"; $this->title = ""; $this->description = ""; $this->link = ""; $this->insideitem = false; } } function characterData($parser, $data) { if ($this->insideitem) { switch ($this->tag) { case "TITLE": $this->title .= $data; break; case "DESCRIPTION": $this->description .= $data; break; case "LINK": $this->link .= $data; break; } } } } $xml_parser = xml_parser_create(); $rss_parser = new RSSParser(); xml_set_object($xml_parser,&$rss_parser); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen("$feed_url","r") or die("Error reading RSS data."); while ($data = fread($fp, 4096)) xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); fclose($fp); xml_parser_free($xml_parser); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.