I'm posting JSON.stringify data to an MVC action and any UTF characters are coming through mangled despite setting the encoding in my javascript. Here's what my jQuery call looks like:
$.ajax({
type: "POST",
url: BaseAppPath + "/Controller/Action",
dataType: "json",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(jsonData),
success: function (data) {
// success code
},
error: function (xhr, textStatus, errorThrown) {
// error code
}
});
My action definition looks something like this:
public JsonResult ModifyTaskStatus(int taskId, string note)
I have a breakpoint on the first line of the action. At that time, the characters in the "note" parameter are hosed. Everything up until the breakpoint handles the characters properly. What do I need to do to ensure my action gets the chinese characters properly?