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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 宇视监控服务器无法登录
    • ¥15 PADS Logic 原理图
    • ¥15 PADS Logic 图标
    • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
    • ¥20 气象站点数据求取中~
    • ¥15 如何获取APP内弹出的网址链接
    • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
    • ¥50 STM32单片机传感器读取错误
    • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
    • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)