开发者

Problem with gzip compressing utf-8 encoded php page. HELP!

开发者 https://www.devze.com 2023-01-04 05:39 出处:网络
i use this at top of my php page: if (substr_count($_SERVER[\'HTTP_ACCEPT_ENCODING\'], \'gzip\')) ob_start(\"ob_gzhandler\");

i use this at top of my php page:

if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
    ob_start("ob_gzhandler");
else
    ob_start();

when page is save with ANSI encoding page was compressed. but when i change page encoding to utf-8 compression was faild. please help!!!

i test compression on ww开发者_JS百科w.gidnetwork.com/tools/gzip-test.php


By guess is that you are including a BOM in your PHP source file when you save in UTF-8 and that's corrupting the compressed stream. Make sure you save in the file in UTF-8 without BOM.

0

精彩评论

暂无评论...
验证码 换一张
取 消