anyone here got a function to find is a string is base64encoded?

jbv jbv.silences at Club-Internet.fr
Sun Jul 25 01:47:19 EDT 2004


>
>
> > Hi Folks,
> >
> > I am trying to determine if a string is base64 encoded, I don't know in
> > advance if it will be or not, but I need to find out so that I can
> > decode as needed. Any hint?
> >
> > cheers
> > andre

I once wrote a MC cgi script that was decoding incoming emails
featuring base64 encoded parts. I just retrieved that script and first
thing it did was to find the following string in the email :
"Content-Transfer-Encoding: base64"
and then it seemed to decide that each following line containing "--"
was base64 encoded.

IMHO this implies 2 things :
1) base64 encoded strings don't pop out of nowhere, they're
always in a context which features a header of some sort that can be
used to make the decision about decoding...
2) without any header indication, there's probably no way to decide
whether a string is base64 encoded...

but I could be wrong...

JB



More information about the use-livecode mailing list