Currently, I am utilizing XMLHttpRequest for an ajax call to my server. Let's consider the call:
http = new XMLHTTPRequest();
var url = "http://app:8080/search.action?value=ñ"
http.open("GET",url,true);
http.setRequestHeader("Content-type", "application/x-wwww-form-urlencoded;charset-UTF-8");
http.send(null);
When receiving the parameter "value" in my action, it contains a question mark symbol instead of the expected character. To address this issue, I have ensured that Tomcat is configured with URIEncoding=UTF-8, implemented a Filter to set CharacterEncoding to UTF-8, and specified page-encoding as UTF-8 in web.xml.
What could be causing this discrepancy in character encoding?
UPDATE: Interestingly, this behavior is unique to Internet Explorer; Safari or Firefox display the ñ character correctly. Any insights on this inconsistency?