jQuery AJAX Post - encoding
I am posting form from page in UTF-8 to page in Win-1250. I have problem with chars encoding.
$.开发者_如何学JAVAajax({
type: 'POST',
url: $(this).attr('action'),
data: $(this).serializeArray()
});
At server - side script you can use something like that:
$res = array();
foreach($_POST as $p)
{
array_push($res,iconv('UTF-8','Windows-1250',$p));
}
$res
- is encoded array
精彩评论