I'm currently grappling with the best approach for handling special or foreign characters within an AJAX request.
My current test code is as follows:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST","test.json",true);
xmlhttp.setRequestHeader("Content-type","application/json; charset=UTF-8");
xmlhttp.send('{"test1":"æøå"}');
Upon receiving this content on the server (IBM Domino), it appears as REQUEST_CONTENT="{"test1":"├ª├©├Ñ"}". How should these strange characters be decoded?
One potential solution could involve using encodeURIComponent() on the value before sending the request. Is this the recommended approach, or are there more effective methods available?