1

I've got a big issue!

I've a site made in PHP with MySQL, I'm getting my data out of my Database where the characters are good! But out of nowhere every character like á and ë e.g. are outputted as a � character.

I hope you guys can help me.

Thanks in advance,

Remy

Azeez Kallayi
  • 2,567
  • 1
  • 15
  • 19
Remy B
  • 61
  • 8
  • Did you inserted the data directly into the database or via a php script? – Fabio Widmer Nov 05 '16 at 21:50
  • Connect to your database using the `UTF-8` parameter, `$mysqli->set_charset("utf8")` – Xorifelse Nov 05 '16 at 21:50
  • I inserted it directly in the database – Remy B Nov 05 '16 at 21:52
  • I presume that you are outputting to a web page. Is the web page UTF-8 encoded and does the font you are using support those characters? –  Nov 05 '16 at 21:53
  • When you directly insert data into the database it will have problems to read it. Inserting data with a php script will automatically fix this issue by encoding the characters. The set_character will also solve the problem. – Fabio Widmer Nov 05 '16 at 21:55
  • There are two scenarios for getting "black diamonds". See http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Nov 05 '16 at 22:12

1 Answers1

1

I followed your problem, and came to the conclusion that I think you forgot to add this tag:

mysqli_set_charset($conn,"utf8");

You should add it before you gather any data from MySQL