Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

£ annoying £ sign

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

Thread Status:
Not open for further replies.
  1. Admin

    Admin Administrator Staff Member

    Joined:
    Jun 2004
    Posts:
    11,120
    Likes Received:
    464
    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
    IWA Meetup
     
  3. rob

    rob Founding Member

    Joined:
    Jan 2005
    Posts:
    5,966
    Likes Received:
    119
    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,292
    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,414
    Likes Received:
    55
    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:
    665
    Likes Received:
    10
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

    Pain...get that with ebay widgets too......
     
  7. Admin

    Admin Administrator Staff Member

    Joined:
    Jun 2004
    Posts:
    11,120
    Likes Received:
    464
    I did that but it didnt help....
     
  8. jimm United Kingdom

    jimm Active Member

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

    mat Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,861
    Likes Received:
    111
    Beat me to it. If you have control over what it displays set it to the above.
     
  10. Admin

    Admin Administrator Staff Member

    Joined:
    Jun 2004
    Posts:
    11,120
    Likes Received:
    464
    I dont no, its an RSS feed
     
  11. JDubya

    JDubya Active Member

    Joined:
    Apr 2010
    Posts:
    92
    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:
    92
    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.