gzip编码? 没见过,帮你顶一下

解决方案 »

  1.   

    string gzdecode ( string $data [, int $length] )
      

  2.   

    参见Zlib Compression Functions类的函数很少用到实在帮不了忙
      

  3.   

    取数据时,不要发送 gzip  头.
      

  4.   

    查了一下,gzip表示数据压缩过
    可能要解压
      

  5.   

    TO  mrshelly(Shelly) 
    "取数据时,不要发送gzip头"
    那应该怎样解码??谢谢
      

  6.   

    之所以取到的数据是 gzip格式的,是因为你发送请求的时候发送了  这个请求头.
    Accept-Encoding: gzip, deflate
    ,你改以下你的代码,去掉  Accept-Encoding: gzip, deflate 这个请求头就可以了
      

  7.   

    或者试一下这个
    $text=gzuncompress($raw_gzip_data);
      

  8.   

    方法有三, 供大家参考:(1) 如果是开发工具支持压缩输出(如 php, csp/eybuild 等都支持),
        临时关闭压缩输出选项, (如注释掉 ebDeflateInit(TRUE); 一句即可)(2) 如果是 webserver 开启了压缩过滤, 则打开 apache 的配置文件, 注释
        掉 mod_deflate 等相关选项, 即关闭输出压缩过滤器, 重启 apache.
        请参考 apache mod_deflate 相关配置.(3) 用 httplook 抓包, 记住选中 "Decode compressed entities" 选项.
        抓到压缩的数据, 它会解开显示.
        结果如下例所示, "Message body has been unpacked." 即表已经解包显示.[code]
    HTTP/1.1 200 OK
    Date: Sun, 29 Apr 2007 09:39:49 GMT
    X-Powered-By: CSP/eybuild-2.3.0
    Content-Encoding: gzip
    Content-Length: 903
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive
    Content-Type: text/html
    <html>
    <head>
    <META content=no-cache http-equiv=pragma>
    <META content="text/html; charset=gb2312" http-equiv=Content-Type>
    <META content="wed, 26 Feb 1997 08:21:57 GMT" http-equiv=expires>
    <title>BBR 登录(V1.1.0)</title>
    <style>
    <!-- 
    p, td, div, b { font-size: 11pt; }
    td {height: 35px;}
    div { color: red }
    #title {font-size: 16px; color: #663300; width: 90px; }
    #text { width: 150px; }
    a:link {color: #000066; text-decoration: none} 
    a:visited {color: #000066; text-decoration: none}
    a:hover {color: #FF0000; text-decoration: underline} 
    a:active {color: #000066; text-decoration: underline}
    -->
    </style>
    <script language=JavaScript><!-- 
    if (top.location !== self.location){top.location.href=self.location;}
    function set_focus() {
    document.forms[0].elements[1].focus();
    }
    -->
    </script>
    </head>
    <body onload="set_focus();">
    <p style="margin-top: 80px">
    <center>
    <form action="" method=post>
      <table width=300 border=1 cellpadding="2" cellspacing="0" bordercolor="#EA8A1C">
        <tr>
          <td height=40 colspan=2 bgcolor="#FFDA00"><strong>登录到 Broadband Router:</strong></td>
        <tr>
          <td id="title">用户名:</td>
          <td height=30><input id="text" type=text name=usrname size=12 value="user"></td>
        <tr>
          <td id="title">口 令:</td>
          <td height=30><input id="text" type=password name=passwd size=12 value="user"></td>
        <tr>
          <td colspan=2 align=center><input type=submit name=login value="提 交"></td>
      </table>
     </FORM><div>
    [ <A href="?!=/login.csp&lang=ch" target=_top>中文</A> |
      <A href="?!=/login.csp&lang=en" target=_top>English</A> |
      <A href="?!=/login.csp&lang=jp" target=_top>日本語</A> ]
    </div>
    <p style="margin-top: 30px">(来自 http://www.eybuild.com)</p>
    </center>
    </body>
    </html>Message body has been unpacked.
    [/code]Good Luck!