user8668708
user8668708

Reputation:

Turkish characters are corrupted in ajax POST call

I have an ajax call as i have mentioned below. The data (ÇçİıĞğÖöÜü) appears to be correct until POST, but data is corrupted when a character set is specified while data is being sent. I have tried it in the following three different character sets, unfortunately nothing has changed.

Character Set

<meta charset="utf-8" />
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">

Ajax Call

var approve = {
    stu_list: stu,
    crn: listCrn,
    cterm:termCode,
    code:listRovr,
    list_other_crn:listOtherCrn,
    list_inst_resp:listInstResp
};

$.ajax({
    type: "POST",
    url: "approve.p_send",
    contentType: "application/x-www-form-urlencoded; charset=utf-8",
    //dataType: "json",
    async:false,
    data: approve,
    success: function() {},
    error: function (xhr, stat, err) {console.log("Error in p_send " + err);}
});

P_SEND Procedure Spec

procedure p_send(cterm in varchar2 default null,stu_pidm in number default null,code in varchar2 default null,crn in varchar2 default null,list_other_crn in varchar2 default null,list_inst_resp varchar2 default null)

Debugging

enter image description here

Network

enter image description here

list_inst_resp=%C3%87%C3%A7%C4%B0%C4%B1%C4%9E%C4%9F%C3%96%C3%B6%C3%9C%C3%BC

Upvotes: 0

Views: 490

Answers (1)

it dũng
it dũng

Reputation: 47

Please check the data type of list_inst_resp.If the posted data(list_inst_resp) is a list of objects you can use this code.

public async Task<IActionResult> Details(string stu,string listCrn,string termCode, string listRovr,string listOtherCrn, JObject list_inst_resp)
{

List<inst_resp> listIR = list_inst_resp.ToObject<List<inst_resp>>();
//... something code
//await...
//...
return Json("good lucky");
}

Upvotes: 0

Related Questions