Re: decode, base64 problem - Mailing list pgsql-novice

From Tom Lane
Subject Re: decode, base64 problem
Date
Msg-id 29545.1590163033@sss.pgh.pa.us
Whole thread Raw
In response to decode, base64 problem  (gmail Vladimir Koković <vladimir.kokovic@gmail.com>)
List pgsql-novice
=?UTF-8?Q?gmail_Vladimir_Kokovi=c4=87?= <vladimir.kokovic@gmail.com> writes:
> I don't know what this is about, so I could get from someone who knows 
> more PostgreSQL than I do,

base64 translates groups of three bytes into groups of 4 characters, so
you can't just randomly chop the result at spots that aren't multiples of
4.  Even if the result happens to look like valid base64 data, the decode
output would be wrong, with bits incorrectly reassembled into bytes.

I'd recommend decoding the whole base64 string and then substring'ing
the result of that.

            regards, tom lane



pgsql-novice by date:

Previous
From: gmail Vladimir Koković
Date:
Subject: decode, base64 problem
Next
From: "David G. Johnston"
Date:
Subject: Re: decode, base64 problem