I am trying to pass a list of data from Mysql
to Android
. A part of that List is written in Hebrew and is stored in Hebrew with utf8 coding:
When I print that list in Json I get question symbols:
[{"Img_ID":"10","Img_root":"images\/beatriz63_19_11_2018_11_56_40.jpg","U_Name":"beatriz63","localname":"????? ?? ??? ??????","zone":"???? ?? ????","category":"????","latitude":"32.0964625","longitude":"34.7741963","comment":"","thisDate":"2018-11-19 11:56:40"},{"Img_ID":"12","Img_root":"images\/beatriz63_19_11_2018_12_25_35.jpg","U_Name":"beatriz63","localname":"???????","zone":"???? ?? ????","category":"????","latitude":"32.0740769","longitude":"34.7922028","comment":"??????","thisDate":"2018-11-19 12:25:35"},{"Img_ID":"13","Img_root":"images\/beatriz63_19_11_2018_12_58_38.jpg","U_Name":"beatriz63","localname":"??? ????? ????","zone":"???? ????","category":"?????","latitude":"32.439070099999995","longitude":"34.878046499999996","comment":"??? ?????? ???? ???? ?????","thisDate":"2018-11-19 12:58:38"},{"Img_ID":"14","Img_root":"images\/beatriz63_19_11_2018_13_11_44.jpg","U_Name":"beatriz63","localname":"?????","zone":"???? ?? ????","category":"????","latitude":"32.0725869","longitude":"34.778971399999996","comment":"","thisDate":"2018-11-19 13:11:44"},{"Img_ID":"15","Img_root":"images\/beatriz63_19_11_2018_13_56_24.jpg","U_Name":"beatriz63","localname":"????? ?? ????","zone":"???? ?? ????","category":"????","latitude":"32.072392","longitude":"34.786619","comment":"","thisDate":"2018-11-19 13:56:24"},{"Img_ID":"16","Img_root":"images\/beatriz63_20_11_2018_00_13_57.jpg","U_Name":"beatriz63","localname":"???? ?? ?? ????","zone":"???? ????","category":"???","latitude":"31.55979881924014","longitude":"35.40268298238516","comment":"","thisDate":"2018-11-20 00:13:57"}]
This is my code PHP
:
<meta charset="UTF-8" />
<?PHP
$hostname_localhost="localhost";
$database_localhost="photogo";
$username_localhost="root";
$password_localhost="Root1234";
$mysqli = new mysqli($hostname_localhost,$username_localhost,$password_localhost,$database_localhost);
$mysqli->set_charset("utf-8");
$myArray = array();
mysql_query("SET character_set_client = 'utf8';");
mysql_query("SET character_set_result = 'utf8';");
mysql_query("SET NAMES 'utf8'");
mysql_set_charset('utf8');
if ($result = $mysqli->query("SELECT Img_ID,Img_root,U_Name,localname,zone,category,latitude,longitude,comment,thisDate FROM dataimage")) {
//$myArray =array("imagedata");
while($row = $result->fetch_assoc()) {
$myArray []= $row;
}
$result->close();
}else{
$row["i_id"]=0;
$row["Img_root"]="No Result";
$row["U_Name"]="No Result";
$row["category"]="No Result";
$row["localname"]="No Result";
$row["zone"]="No Result";
$row["category"]="No Result";
$row["latitude"]=0;
$row["logitude"]=0;
$row["comment"]="No Result";
$row["thisdate"]="No Result";
$myArray['imagedata'][]=$row;
}
//echo hebrev (json_encode($myArray));
echo json_encode($myArray);
$mysqli->close();
?>
I've tried to do everything but I still can not get past those signs to Hebrew.