help with unknown characters in The Register's feeds

Discussion in 'XML & RSS' started by rosytoes, Jun 20, 2006.

  1. #1
    You can try any of the feeds here. At the end of each description, there are a full stop and what looks like to be another 3 full stops but they are not. After being inserted into the database, these extra "full stops" are stored as a question mark. When I display these feeds on a page, at the end of every description, I see .?
    I am using magpie, any suggestions of getting rid of these dots?
     
    rosytoes, Jun 20, 2006 IP
  2. ipheo.com

    ipheo.com Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Never heard of magpie, but yeah, nothing very difficult here, you just need to replace/remove the three dots (which is one character actually, … in html). Depending how you store those feeds in the database, you can do that in php with str_replace or even substr (if you have a specific field for the description).
     
    ipheo.com, Jun 21, 2006 IP
  3. rosytoes

    rosytoes Peon

    Messages:
    230
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you for introducing me to … I've never heard of it before. However, str_replace "..." and str_replace"…" didn't work. When I view source, they weren't written as …, they were just 3 dots. In the end I used str_replace(".?",".",$desc) which is not ideal but have to do for now.
     
    rosytoes, Jun 21, 2006 IP
  4. vishwaa

    vishwaa Well-Known Member

    Messages:
    271
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    138
    #4
    "…" is a single character. I guess that you try to match the "…" character by giving 3 continuous dots as the search pattern in your code.

    Instead you might want to try this code. It works for me.

    str_replace("…","…",$txt);
    PHP:
     
    vishwaa, Jun 21, 2006 IP