IE 7/8/9 , £ displayed as "?" .. Ajax + POST + Jquery and JSON .. what can fix IE character encoding Issue

134 Views Asked by At

I have a string like "£300 ON 110406" which I'm displaying to User. following is the Ajax which is getting fired to the spring controller which returns the data from DB:-

DB values are getting pushed through a separate Product , so can't change anything there.

$.ajax({ header:{ Accept:"*/*", "Mime-Type":"application/x-javascript;charset=iso-8859-15" }, type: "POST", cache: false, dataType:'json', url: ctx + "/url.htm", data: str, beforeSend: function(jqXHR) { if(jqXHR && jqXHR.overrideMimeType) { jqXHR.overrideMimeType('application/x-javascript;charset=iso-8859-15'); } },

previously above string was not coming fine on FIreFox and Chrome as well but after i added "beforeSend" method , now they are coming fine.

but IE still gives BOX characters.

Above Ajax code I have modified after googling most of the questions available for similar issue.

My page says below :-

<%@ page language="java" contentType="text/html; charset=iso-8859-15" pageEncoding="iso-8859-15"%> <% request.setCharacterEncoding("iso-8859-15"); %> <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">

On my other page , I'm displaying same value but using Scriptlet so there no issues.

signature of my spring controller method:- If i add produces to this method , i get "cannot find presentation in browser console"

@SuppressWarnings("unchecked") @RequestMapping(value = "/url", method = RequestMethod.POST) private @ResponseBody String getFilteredData(

Jquery version is 1.11

I have been trying this in IE but it just don't work.. below is the screen shot from IE browser to show Accept and content-type.

If i change content type in Ajax then it does send data to the controller.

enter image description here

can you please let me know , how this can be resolved.

0

There are 0 best solutions below