base64 and PyGreSQL
Agent Drek
drek at zupa.bigstudios.com
Fri May 19 09:29:20 EDT 2000
On Fri, 19 May 2000, Guido van Rossum wrote:
> Agent Drek wrote:
> >
> > Why does the base64 module append a '\012'?
> >
> > I'm using base64 to send data into a PostgreSQL database so that
> > arbitrary data including ''s and "'s can be entered by the user's ...
> > is this the correct way to do this?
> >
> > right now :
> > string.strip(base64.encodestring(eggs))
> >
> > I'm using PyGreSQL.
>
> You seem to have found the solution for your problem.
>
> The answer to the "why" question is simply that in the context
> for which base64 was originally designed (encoding binary files
> as part of email) the output is always a number of lines,
> so it makes sense to add the linefeed.
>
but then I found this ...
http://x21.deja.com/[ST_rn=ps]/getdoc.xp?AN=622650236&CONTEXT=958686821.703332360&hitnum=12
this sounds resonable:
> (using base64 encoding will make your database some 33%
> larger, and mess things up if you want to access the data
> from some other application...)
and now I can't seem to get cgi.escape(mystring) to spit out things like
&lg ,etc.
I haven't been able to find other opinions. Can anybody educate me
on this process?
--
<why-me>-ly y'rs,
Agent Drek
Big Animation Inc > 'digital plumber'
http://www.bigstudios.com
More information about the Python-list
mailing list