Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UTF-8 Encoding still wrong output

I have an encoding problem.

The table uses utf8_general_ci, the php header header("Content-Type: text/html; charset=utf-8"); and in the html the meta tag <meta charset="utf-8"> is set. BOM is set right. The german chars are displayed right in phpmyadmin.

But when I output it the encoding results: Sask���

Any other idea what I can do?

like image 988
Michael Brenndoerfer Avatar asked Jan 11 '23 12:01

Michael Brenndoerfer


1 Answers

This solves the problem

mysqli_query($link, "SET NAMES 'utf8'"); 
mysqli_query($link, "SET CHARACTER SET 'utf8'"); 
like image 132
Michael Brenndoerfer Avatar answered Jan 16 '23 20:01

Michael Brenndoerfer