pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: James Orr <james@lrgmail.com>
Cc: Jeremy Buchmann <jeremy@wellsgaming.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: bytea on windows perl client
Date: Wed, 17 Jul 2002 12:09:35 -0700
Message-ID: <3D35C0EF.6070104@joeconway.com> (raw)
References: <2249A4CB-99A9-11D6-BECC-000502E740BA@wellsgaming.com>
	<200207171337.16475.james@lrgmail.com>

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




view thread (10+ messages)  latest in thread

Message-ID: <3D35C0EF.6070104@joeconway.com>
Permalink:  ../3D35C0EF.6070104@joeconway.com/
Also on:    postgresql.org/message-id/3D35C0EF.6070104@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: mail@joeconway.com, james@lrgmail.com, jeremy@wellsgaming.com
  Subject: Re: bytea on windows perl client
  In-Reply-To: <3D35C0EF.6070104@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox