I have a PHP/MySQL application, where it needs to work with UTF-8 characters behind-the-scenes (the UTF-8 characters won't be shown on-screen). The UTF-8 characters are from a PHP cURL request.
What do I need to do to make PHP and MySQL properly function with UTF-8 characters?
Do I need to set
default_charset = utf-8in php.ini? Or is this only used when data is displayed on-screen?Do I need to set the character set/collation to utf8/utf8_general_ci for my databases, tables, and columns?
I read that there's also a such thing as connection character sets for MySQL. Does this really matter?
- Is there anything else I need to do?
Thanks for the help.
SET NAMES 'utf8';query on the database, right after you fetch any results.