HTTP get, UTF-8


I am getting data from a server and output it in ionic 2.
However characters like ö,ä,ü etc… are shown as “?”. I want them to display correctly, how can I handle this ?


Solution found:

Had to decode utf8 in server response.


i need to decode reponse like this , how to do it ?

app.controller(‘courseCtrl’, function($scope, $http) {
$http.get(“http://www.xxxxxxcom/dev/course.php”).then(function (response) {
$scope.myData =;



You need to put **decode_utf8();** into your php file on your server :slight_smile:


Yes thank you
I have found the solution

{header : {‘Content-Type’ : ‘application/json; charset=UTF-8’}
}).then(function (response) {
$scope.myData =;

and in my php script

mysqli_set_charset($mysqli, ‘utf8’); // MYSQLI CHARSET UTF-8

while ($row=mysql_fetch_object($q)){

echo json_encode($data);