views:

23

answers:

1

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 www.gidnetwork.com/tools/gzip-test.php

+1  A: 

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.

Artefacto
perfect guess!! the problem was BOM character at beginning. thanks artefacto
MoosaMaher