MoosaMaher
MoosaMaher

Reputation: 45

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

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

Upvotes: 1

Views: 1893

Answers (1)

Artefacto
Artefacto

Reputation: 97805

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.

Upvotes: 2

Related Questions