I know this question has already been asked here, but there is still no solution for me ...
I have $http.post request to the server. It should return me the JSON file.
$http.post(getCountry, angular.toJson({country: true})).then(function (data) {
$scope.countries = data.data;
console.log( 'Success', $scope.countries);
}, function (err) {
console.log('err');
});
The php code, which should send request to MySQL is as fallows:
$connection = mysqli_connect($server, $login, $password, $db) or die("Connection error" . mysqli_error($connection));
if ($country == 1) {
$sql = "SELECT name_ru, id FROM net_country ORDER BY name_ru";
$result = mysqli_query($connection, $sql) or die("Error in Selecting " . mysqli_error($connection));
}
$emparray = array();
while($row =mysqli_fetch_assoc($result))
{
$emparray[] = $row;
}
echo json_encode($emparray);
This one returns JSON with "?????" instead of the "name_ru" When I change "name_ru" to "name_en" - everything is ok.
I have no idea how to fix it. UTF-8 charset is everywhere