Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
01-28-2014, 09:07 PM #1
- Join Date
- Jun 2010
- 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.
01-29-2014, 01:30 AM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- 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:
Simple as that.PHP Code:
header('Content-type: text/html; charset=utf-8');
Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');