I'm sending a string using jQuery AJAX POST and JSON:
$.ajax({
type: "POST",
dataType: "JSON",
url: "someUrl.asp?param1=someParam1",
contentType: "charset=utf-8",
data: JSON.stringify({
some_code: $( "#some_code" ).length > 0 ? $("#some_code").val() : ''
})
})
Serverside is VBScript/ASP.
some_code
is a textbox with following text: someValue čšžćđ
that needs to be saved just like that.
When scanning network traffic (IE9) I see this: some_code=someValue Äšžćđ
When looking in the database (Oracle 12c) I see this: someValue ?????
Html page encoding is Windows-1250. NLS_LANG and NLS_CHARACTERSET are Slovenian
.
I've tried out advice from at least a dozen different links, but to no avail, so I'm turning to you guys and girls. Thank you!
Right from the comments think I understand the issue;
The JSON has to be sent as contentType: "charset=utf-8"
so the page someUrl.asp
will also need to process in UTF-8
to do this follow the below steps.
Based on your comment have made some changes to the below code.
First re-save the someUrl.asp
file using UTF-8
encoding not ASCII
.
Set the first line in someUrl.asp
to;
<%@Language="VBScript" CodePage = 65001 %>
Then add the following lines;
<%
Response.Charset = "Windows-1250"
Response.CodePage = 1250
%>
Note: When making changes always remember to save the file with
UTF-8
encoding.