Received: from joeconway.com (unknown [63.210.180.150]) by postgresql.org (Postfix) with ESMTP id 5F66647585D for ; Wed, 17 Jul 2002 15:10:12 -0400 (EDT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 3.5.9) with ESMTP-TLS id 1173887; Wed, 17 Jul 2002 11:42:42 -0700 Message-ID: <3D35C0EF.6070104@joeconway.com> Date: Wed, 17 Jul 2002 12:09:35 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: James Orr Cc: Jeremy Buchmann , pgsql-interfaces@postgresql.org Subject: Re: bytea on windows perl client References: <2249A4CB-99A9-11D6-BECC-000502E740BA@wellsgaming.com> <200207171337.16475.james@lrgmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200207/105 X-Sequence-Number: 2914 James Orr wrote: > On Wednesday 17 July 2002 01:17 pm, Jeremy Buchmann wrote: > >>>>\211PNG\015\012\000 and so on. >>> >>>This is the escaped output form of bytea. It seems that on linux the >>>perl script is either using a binary cursor, or automagically >>>unescaping the output, while on windows it isn't. I'm not sure why that >>>would happen, but hopefully one of the perl gurus hanging around will >>>chime in. >>> >>>Joe >> >>James, >> >>This may be a long shot, but try to binmode your output stream: >> >>Let us know how it works. > > > I did this ... > > print "Content-type: image/png\n\n"; > binmode STDOUT; > print $image; > > Didn't work. Does perl (or one of the available libraries) have a function like PHP's stripcslashes()? See: http://www.php.net/manual/en/function.stripcslashes.php If so, you should be able to do something like: print "Content-type: image/png\n\n"; print stripcslashes($image); HTH, Joe