Currently facing an issue with my new web app that I haven't encountered in the past. Experimenting with a simple code snippet like this:
var jsonToSend = {hello: "woørld"};
app.get('/someUrl', function(req, res) {
res.setHeader('Content-Type', 'application/json');
res.send(jsonToSend);
}
The output displays as: {"hello":"Woørld"}
along with
Content-Type:application/json; charset=utf-8
in the network tab. Attempted using JSON.stringify
and adjusting the setHeader
charset setting, but still not getting the expected result. How can I ensure the server is encoding the data correctly?
Using WebStorm and already confirmed file encoding is set to UTF-8
.