Jump to content

Recommended Posts

Posted (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 by orange77
Posted

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.

Posted

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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...