0

I have ñ's and á's in the cells of my database. My collation is set to utf8, but on the website my characters are not displaying right.

Esperamos que disfrute del programa y aprenda bastantes consejos 
�tiles para padres para mejorar el desarrollo de su hijo. Tambi�n 
puede aprender de otras mam�s y ellas de usted. El Foro...

Displaying it via SELECT statement and then through php on the page. Let me know if you need more information. Perhaps this is a common problem?

manuell
  • 7,528
  • 5
  • 31
  • 58
broinjc
  • 2,619
  • 4
  • 28
  • 44

2 Answers2

1

Try with this header at the top of your php script:

header('Content-Type: text/html; charset=utf-8');

and/or the META tag as a linked answer says.

<meta charset="utf-8">
Community
  • 1
  • 1
Luigi Siri
  • 2,068
  • 2
  • 19
  • 27
1

After checking that my charset was correct, this did the trick.

class DBMySQL{
// ...
    private function set_connection($connection) {
        $this->_connection = $connection;
        mysqli_set_charset($connection, "utf8"); // VICTORY!
    }
// ...
}
broinjc
  • 2,619
  • 4
  • 28
  • 44