Possible Duplicate:
UTF-8 all the way through
I am scraping data with curl from a web which have word Café. It looks fine when i echo it but after insert in mysql data base it become Café
How to handle it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PHP: internal encoding, file encoding
Runtime configuration:
And set the file encoding in you text editor to UTF8 without BOM (for example in Notepad++: Encoding menu, then Convert to UTF8 without BOM)
MySQL: table, column encoding/collation
Set all encoding and collation to UTF8 in you editor/designer (PhpMyAdmin).
Between them: connection encoding/collation
I don’t know what driver are you using, for mysqli (and for mysql but please don’t use that):
PDO has it’s own configuration for this, see php.net.
Response encoding
Set it with a header call:
header('Content-Type: text/html; charset=utf-8');