HTML5 / JSON: UTF-8 cannot read correct characters from json

My HTML5 application uses JSON to retrieve data.

Json contact characters: ö

but the output in my browser looks like this:

In the HTML5 header, I used the following:

<meta http-equiv="Content-Type"content="text/html;charset=utf-8">


and used this in AJAX to read JSON:

    url: "items.json",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(response) {


But that doesn't help me. What will be the solution? I even tried "ISO-8859-1" in both places.


source to share

1 answer

Make sure the font family you are using for your site supports the extended characters you are trying to print. Then use firebug or something similar to see what character your backend json service is setting. He might not send it back. Also, check if firebug is showing the correct character in the JSON response. Perhaps the problem is even bigger than you thought.



All Articles