UTF-8 problem

Discussion in 'PHP' started by Tibiacity, May 10, 2008.

  1. #1
    Hello,

    I have a problem with using French and a UTF-8 encoding. It doesn't display some characters, such as é in dates; e.g. it displays 21 f�v 2008 instead of 21 fév 2008.

    You can see it live here: http://fr.tibiaml.com/ at the news at the bottom of the page.


    Anyone knows what to do?
     
    Tibiacity, May 10, 2008 IP
  2. Blazej

    Blazej Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You must save document in notepad ++ with "UTF-8 with BOM"
     
    Blazej, May 10, 2008 IP
  3. Tibiacity

    Tibiacity Active Member

    Messages:
    190
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    It gives a "headers already sent" error if I save it as UFT-8 document :(
     
    Tibiacity, May 10, 2008 IP
  4. Tibiacity

    Tibiacity Active Member

    Messages:
    190
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #4
    Anyone has any sugestions?
     
    Tibiacity, May 12, 2008 IP
  5. kreoton

    kreoton Peon

    Messages:
    229
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    save document in UTF-8 without BOM. UTF-8 with BOM creates invisible character on top of your document so you get error 'headers already send'
     
    kreoton, May 12, 2008 IP
  6. Tibiacity

    Tibiacity Active Member

    Messages:
    190
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #6
    How do I save it like that? Can I do it with notepad?
     
    Tibiacity, May 14, 2008 IP
  7. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    omg i had this problem for so long until i decided one day to change the php filename to .phps, and then run it in a browser; to my horror there it was, an invisible number of 'invisible' characters at the beginning!!
    too bad i hadn't found this post about 3 months ago... :lol:
     
    szalinski, May 17, 2008 IP
  8. Tibiacity

    Tibiacity Active Member

    Messages:
    190
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #8
    Yea I got the problem with the invisible characters too. You solved it by chnaging extention?
     
    Tibiacity, May 20, 2008 IP
  9. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #9
    no, you have to change the filetype (you can't change the extension since it is .php??). make sure you make the file in notepad to start off with (some text editors can save as utf-8 format which screws up the headers and other stuff). :)
    i just changed it to .phps so i could view it as source code in my browser. ;)
     
    szalinski, May 20, 2008 IP
  10. Tibiacity

    Tibiacity Active Member

    Messages:
    190
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #10
    But I saved it as utf-8 using notepad and it added those invisible characters. How can I get rid of them?
     
    Tibiacity, May 20, 2008 IP