orange77 Posted June 1, 2020 Posted June 1, 2020 (edited) My website is in Brazilian Portuguese. And as you know, this is a language that uses special characters such as accents, cedillas, tildes, etc. And those characters are not being recogzined. I heard that something like this would solve: ini_set('default_charset','UTF-8'); But even so, it didn't work out. My html is set as charset=utf-8. And nothing. My database is set as utf-8_general_ci, so are the tables in it. What solution can solve this problem? Edited June 1, 2020 by orange77
orange77 Posted June 1, 2020 Author Posted June 1, 2020 If you're using PDO, just add this: array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET CHARACTER SET utf8, NAMES utf8") And it'll work fine.
orange77 Posted June 1, 2020 Author Posted June 1, 2020 If you're using PDO, just add this: array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET CHARACTER SET utf8, NAMES utf8") And it'll work fine.Oh, Gosh. It worked. Thank you so, so much!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now