Well, readed tens of threads of insertin JSON to mysql, but not find a solution for this.
SO, i have file that gets JSON over FTP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<?
include ('mysql_php7.php');
mysqli_query ($con,"SET NAMES 'utf8'");
$d = file_get_contents("-FTP ADDRESS-");
echo "<PRE>$d</PRE><br><br>";
mysqli_query($con,"INSERT INTO json (json) VALUES ('$d')") or die(mysqli_error($con));
?>
</html>
At his moment, ftp file has succesfully picked up, and used just to test it, the PRE funktion and all showing up nicely, no errors, and all what i need.
Then insertin it to mysql, no problem so far.
But, when checking mysql, there is black ? mark after EVERY Character.
JSON file has also few "ä" character, and mysql insert stop before first of them so it not import full file to mysql.
JSON file is ok, tested it multiple validators in the net, and has good results.
My php file is coded utf w/o BOM with notepad++, ALL mysql tables/columns are utf8 general format, i have headers on php file also to check charset is utf8.
Spended now over 3 days to trying to get this work but cant get it imported to mysql.
And, one thing more. If i manually copy and paste JSON file data to mysql row, its working normally. No ? marks after every character and i can use json_decode after that.