I am trying to get a JSON object from a restful service. When I plug the URL into my browser (Firefox or Chrome) I receive the JSON with the proper UTF-8 encoding:
{"name":"Université"}
However, when I attempt to GET the same URL in my Angular app, the text is not properly encoded. This is the object printed out from the JavaScript console:
{ name: "Universit�"}
Here is the code I'm using in Angular:
$http(
{
method: "GET",
url: 'localhost:8080/my/url/location',
headers : {
"Accept":"application/json;charset=utf-8",
"Accept-Charset":"charset=utf-8"
}
}
).success(function(data,status,headers,config){
console.log(data);
/* the rest of the success function */
}).error(function(data,status,headers,config){
/* the rest of the failure function */
});
Any ideas? Thanks ahead of time!
application/json; charset=UTF-8. Thank you!