SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    file_get_contents() Problem

    Hey Guys,

    I'm having problems with some characters when reading the contents of some RRS feeds. The problem is for characters like copyright sign, euro sign and pound sign that are not encoded as © etc. Here is an example....

    File I'm Reading From ( part of a FT.com rss )
    http://www.nojacko.com/ftrss.html

    Here's what I get
    http://www.nojacko.com/reader.php

    As you can see the euro goes wrong. Anyone know why this happens and how I can sort it? I've tried copying the error and using string replace but that doesn't work.

    Thanks in advance
    Jacko

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It would work, if you created a complete html document and specified utf8 charset.
    Saul

  3. #3
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ... or if you sent a content-type header, specifying that you are serving UTF-8 content. Or if you set UTF-8 as the default charset for your browser (You probably have cp-1252 instead, but that's just your local setting, it's not a standard).

  4. #4
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Guys

    Code PHP:
    header('Content-type: text/html; charset=utf-8'); // Was that I needed

    Once again thanks!!!


Bookmarks

Posting Permissions

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