There are a lot of topics who discuss my problem but I cant still solve it.
I have a database which I encode by JSON. But when I put content with german char like ä, ö, ü etc the output is empty.
Here is my php script:
<?PHP
error_reporting(E_ALL);
ini_set('display_errors', '1');
//Verbindung zur Datenbank
include "inc_mysql.php";
//SQL-String
$select = "SELECT * FROM module ORDER BY name ASC";
//SQL-Befehl in Variable speichern
$sql = mysql_query($select);
//********************this one was missing!********************
mysql_set_charset("utf8");
//Array erstellen
$jsonArray = array();
while ($row = mysql_fetch_array($sql)){
$jsonArray[] = $row;
}
echo json_encode($jsonArray, JSON_UNESCAPED_UNICODE);
?>
The php file is UTF-8 without BOM.
The column is the dabase is utf8_general_ci.
BTW: The error reporting just says something about mysql_query() is depricated.
Might be a easy game for you guys :)
Solution found! Check the code!