All pastes #922910 Raw Edit

Anonymous

public text v1 · immutable
#922910 ·published 2008-02-29 02:41 UTC
rendered paste body
    # Note that Compress::Zlib::memGunzip() destroys its input, thus $body2 .
    # There seems to be a bug (?) in Compress::Zlib such that compressing and
    #   then uncompressing some strings (ones with non-ASCII characters?) does
    #   not result in the original string.  One example is watan.com, which
    #   uses the "windows-1256" encoding.  Thus, only send the gzip'd $body if
    #   decompression exactly undoes compression.  Inefficient.  :(
    # jsm-- is there a better way, e.g. simply not compressing windows-1256
    #   text, or converting all text to utf-8?
    if ($ENV{HTTP_ACCEPT_ENCODING}=~ /\bgzip\b/i) {
	eval { require Compress::Zlib } ;
	if (!$@) {