I found an issue trying to update a Postgres database (UTF-8) from an ajax call which contains Turkish characters in their body. I have a simple json with id and name attributes, name contains 'Kumar oyunları risk taşır' and on the database is saved "Kumar oyunlar�� risk ta����r"
$(document).ready(function () {
$("#sendToServer").click(function(){
var json = '{"name":"Kumar oyunları risk taşır", "id": 123'};
var server = "http://10.16.0.89:8080";
var apiURL = server + "/api/content/publish/create";
var dataform = new FormData();
dataform.append('json', JSON.stringify(json));
getURL = $.ajax({
url: apiURL,
type: 'PUT',
cache: false,
data: dataform,
contentType:false,
success: function (result, request, response, data, status, xhr) {
alert('Success!');
}
});
});
...
<button id="sendToServer">Send to server</button>
There is no issue if json is used instead of dataform ( data: json ) BUT I really need it to use it because I gotta append a file in my app.