Domain Manage

£ annoying £ sign

Discussion in 'Scripts and Coding' started by admin, May 10, 2010.

Thread Status:
Not open for further replies.
  1. admin Spain

    admin Administrator Staff Member

    Joined:
    Jun 2004
    Posts:
    10,083
    Likes Received:
    115
    Anyone know how to fix this: Current price: £35

    on the homepage reading the DL RSS feed.

    Thanks

    Admin
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
     
  3. rob

    rob Founding Member

    Joined:
    Jan 2005
    Posts:
    5,953
    Likes Received:
    68
    Check doctype declarations , or could be the feed outputting incorrectly.

    Do you have direct link to the feed?
     
  4. retired_member13

    retired_member13 Banned

    Joined:
    Jul 2009
    Posts:
    1,317
    Likes Received:
    33
    That error is normally caused by the character encoding - ISO versus UTF, ie the feed is encoded as one and the script is treating it as another.

    Regards

     
  5. tifosi United Kingdom

    tifosi Well-Known Member

    Joined:
    Oct 2004
    Posts:
    3,128
    Likes Received:
    45
    Needs the header to be UTF8.

    In php this can be done with e.g:

    header('content-type: text/html; charset: utf-8');
     
  6. nnh United Kingdom

    nnh Active Member

    Joined:
    Jun 2006
    Posts:
    650
    Likes Received:
    10
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

    Pain...get that with ebay widgets too......
     
  7. admin Spain

    admin Administrator Staff Member

    Joined:
    Jun 2004
    Posts:
    10,083
    Likes Received:
    115
  8. jimm United Kingdom

    jimm Active Member

    Joined:
    Feb 2008
    Posts:
    688
    Likes Received:
    13
    Is it going into your db?
    If so just do a replace on £ to &pound;
     
  9. mat United Kingdom

    mat Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,782
    Likes Received:
    73
    Beat me to it. If you have control over what it displays set it to the above.
     
  10. admin Spain

    admin Administrator Staff Member

    Joined:
    Jun 2004
    Posts:
    10,083
    Likes Received:
    115
  11. JDubya

    JDubya Active Member

    Joined:
    Apr 2010
    Posts:
    94
    Likes Received:
    7
    You can try just before outputting the data pushing it through the php function:

    $string = utf8_encode( $string );
    OR
    $string = utf8_decode( $string );

    Because although you have changed the doc type to utf-8, firefox (in my case) is ignoring this tag and rendering the page in ISO-8859-1. If I go View -> Character set encoding in my browser, and select manually "utf-8" it rectifies the problem with some of the weird symbols I can see on this page.

    My guess is - VB was configured not to use utf-8 and your DB tables will not be in utf-8 but probably the latin1 swedish_ci charset - meaning your templates stored in the DB are not in utf-8. So that's why my browser is ignoring the utf-8 character declaration in the header. And the data with the weird pound sign is probably coming in as utf-8.

    So maybe utf8_decode() will convert it to the same as the page. You will also need to remove the header charset=utf-8 declaration.
     
  12. JDubya

    JDubya Active Member

    Joined:
    Apr 2010
    Posts:
    94
    Likes Received:
    7
    Some RSS feeds allow you to specifiy the charset - or at least let you know what it is.
     
Thread Status:
Not open for further replies.

Share This Page