weixin_33721427 2016-10-10 14:49 采纳率: 0%
浏览 41

编码问题ajax请求

I have an encoding problem (only in Firefox, I tested with IE and Chrome) when I send a request with AJAX and AJAX requests only.

I'm under PHP5 / apache.

The encoding used in my site is ISO (for historical reasons), I can not change it (customer constraint).

So when I send data via an ajax request, they are retrieved UTF-8 despite that sending is done well in ISO (I checked via the debug console).

Headers of the request and page (PHP and HTML) are ISO-8859-1, as well as encoding of the page is in ISO.

I checked the php.ini settings and those of the httpd.conf, it is makes no mention encoding in UTF-8. When that was the case I changed the lines to iso.

I also tested the additions as follows "AddDefaultCharset iso-8859-1" at the http.conf or .htaccess, but nothing there.

Note that this problem has occurred since august 26, why ? (no deployment)

If anyone had the same problem and has a solution or a track start, I thank in advance.

I already try something like that :

$.ajax({
        url: 'page.php?controller=test_encodage&civ='+civ+'&nom='+nom+'&prenom='+prenom+'&qualite='+qualite+'&afficher=1',
        type:'POST',
        contentType: 'application/x-www-form-urlencoded; charset=iso-8859-1',
        beforeSend: function(jqXHR) {
            jqXHR.overrideMimeType('text/html;charset=iso-8859-1');
        }
    });

and it's steel doesn't work

</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 西门子S7-Graph,S7-300,梯形图
    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效
    • ¥15 悬赏!微信开发者工具报错,求帮改