【发布时间】:2016-02-11 11:11:37
【问题描述】:
如何为ajax post请求设置utf-8?
我将此代码用于 ajax 发布请求
$.ajax({
url: 'test.php',
dataType: 'text',
cache: false,
contentType: false,
processData: false,
data: form_data,
type: 'post',
success: function(php_script_response){
$('#files_attachments_list_display').append(php_script_response);
}
在test.php,我尝试往db中插入数据,ok,插入成功。
但是插入的字符不是utf-8。如何在 ajax 发布请求上设置 utf-8?
【问题讨论】: