Results 1 to 6 of 6
  1. #1
    More Cheesier Than Ever Cheesehead's Avatar
    Join Date
    January 18th, 2005
    Location
    Land of The NFL Champs!
    Posts
    2,942
    What Causes 
    I have a feed creating a php page. I then have a server side include. The php page loads in fine, but is always preceded by 

    What causes this and how do I get rid of it?
    This World is Not My Home
    We're gonna go inside, we're gonna go outside, inside and outside. . . And then we're gonna go go go and we're not gonna stop til we get across that goalline! Quotes from the movie Rudy, 1993

  2. #2
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    Those characters are in your feed file. They are not due to your includes, php, mysql or any processing that you're doing. Take your CSV file that you're uploading and importing, plop a copy on your desktop, open with Excel and you'll see those same characters at the start of the feed file. Exit Excel without saving any changes. Open the same CSV file with Notepad or Wordpad, and you won't see them. It's a conversion / character set issue that arrives from the way the datafeed producer derives and converts formats to create the original file.

    To work around this, make sure the first row contains headers (or dummy info) and skip importing the first row.

    This issue is not uncommon.

  3. #3
    More Cheesier Than Ever Cheesehead's Avatar
    Join Date
    January 18th, 2005
    Location
    Land of The NFL Champs!
    Posts
    2,942
    Thanks Donuts!
    This World is Not My Home
    We're gonna go inside, we're gonna go outside, inside and outside. . . And then we're gonna go go go and we're not gonna stop til we get across that goalline! Quotes from the movie Rudy, 1993

  4. #4
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    And if the source can't be edited (like in RSS feeds), try php preg-replace code to look for those 3 weird characters and replace them with null whenever this happens.

    See Dirk Gardner's post for how to do that... think the thread title is "creating automated bulletproof sites..." here at ABW.

  5. #5
    More Cheesier Than Ever Cheesehead's Avatar
    Join Date
    January 18th, 2005
    Location
    Land of The NFL Champs!
    Posts
    2,942
    I Fixed It!
    I went to a PHP forum, and read that this problem is caused by the character set and use of a notepad text editor. They recommended PHP Expert Editor. Load the script in this and the funny character can be edited out. I downloaded this software and was about to install it when I remembered I have Cute HTML. I tried Cute HTML to edit and then save the script as a PHP file. Uploaded and the junk was gone!

    PROBLEM SOLVED!
    Last edited by Cheesehead; April 3rd, 2006 at 07:51 PM.
    This World is Not My Home
    We're gonna go inside, we're gonna go outside, inside and outside. . . And then we're gonna go go go and we're not gonna stop til we get across that goalline! Quotes from the movie Rudy, 1993

  6. #6
    Newbie
    Join Date
    January 4th, 2006
    Location
    Berlin
    Posts
    41
    Sorry to dig this up, but yes it is the character encoding inside the data feed, for others this is the reason why perhaps you will see j instead of a british pounds sign or other things.

    One thing to remember is that in english we are quite safe from most encodings as the english characters are the same but special characters and foreign characters can display rather badly, to date i have not seen a network that actually worries about converting the charset of data into something standard and so you can actually find that people have morethan 20 different charsets of data in their database but dont actually know that. Does not make any difference until you see strange characters.

    Finally, just because a file says it is UTF-8 for example or it was saved as a utf-8 file, it doesnt mean it is. The actually binary of each character could be anything and so you will never know ;-).

    The only real way to deal with it is to convert characters to a standard encoding like we do, we detect (pain in the ass) each files encoding and always convert to UTF-8 (you could look for something called iconv to help you if you need it). For most people they do not worry about the odd character being a bit out of sink, especially when the other millions are all ok.

    Hope that offers help to someone of a similar nature.

  7. Newsletter Signup

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •