accent ajax encoding issue

吃可爱长大的小学妹 提交于 2019-12-01 23:59:55

This is because you are displaying UTF-8 encoding of é (0xc3, 0xa9) as Latin-1. So the search_word was encoded as UTF-8 when it posted to PHP.

Try this,

$.ajaxSetup({
        scriptCharset: "iso-8859-1",
        cache: false
});
Pekka 웃

That is because the default return type of an AJAX call is UTF-8. Try

utf8_encode($output);

in your ajax snippet. Alternatively, you can change the encoding of the AJAX request as described here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!