如何用javascript中的json解码iso 8859-1中的字符utf-8?

In php I select data and display in php with last code

utf8_decode(json_encode($resultat, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));

and get this result : [ { "NUM_ASSU": "321-7777777-4", "NOM_ASSU": "MÀJIOTSOP TIAYA VALERIE" } ] with correct data and accented characters. but when I am back in Javascript coded with ExtJs framework it displays nothing. this is the code: var jsonData = Ext.util.JSON.decode(result.responseText, true); jsonData appears empty.

Your server application has to communicate with the client in the correct encoding. The page encoding is set usually in page header, e.g.

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

In this case you have to encode your server response in windows-1250. But I'd rather stick with utf-8 as other people say.

You can check your current page encoding like this:

alert(document.characterSet);

Side note: can you inspect result.responseText?