Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Encoding problem - not showing utf-8

    Hello to everyone, great community.
    I'm having this problem, and been trying for weeks now to solve it, but no luck . If you guys could help me it would be great.
    I have 3 .php files, for inserting grades into DB, update results, and one for reporting results (all files attached, I just changed extension to .txt so I can upload them). I changed encoding from UTF-8 without BOM to UTF-8 in Notepad++, but still no luck.
    Problem is I can't get it to show utf-8 characters when reading from DB. I changed encoding in DB and tables, and everything is set to "utf8_general_ci", and characters are showing correctly in table when I check them via phpMyadmin.
    I would appreciate any help.
    Many thanks in advance.
    Attached Files Attached Files

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    You need to push the proper headers and html elements for the content type. Typically I find the headers are sufficient:
    PHP Code:
    header('Content-type: text/html; charset=utf-8'); 
    Simple as that.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

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