Results 1 to 2 of 2

Thread: utf8 read from file

  1. #1
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default utf8 read from file

    i am trying to read from a long list of files that are in my directory then process this list. when utf8 characters, the list comes out like this:
    l’Été that show up like this ��t�

    heres an example of what i have
    http://bit.ly/zQrQns

    this didnt do anything
    Code:
    $str = "l’Été";
    utf8_decode($str);
    echo $str;

    re: utf8_encode fixed it
    Last edited by ggalan; 02-24-2012 at 11:08 PM.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Make sure (in order of importance):

    1. Your data is UTF-8 encoded (this includes your database, if applicable).
    2. Your server is sending utf-8 headers.
    3. Your HTML has utf-8 meta tags.

    numbers 1 and 2 are the most common problems. (Number 2 especially - if your server sends headers specifying a different encoding, the browser will try to use that encoding, even if the meta tag says "utf-8".)

  3. The Following User Says Thank You to traq For This Useful Post:

    ggalan (03-01-2012)

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
  •