Re: decode, base64 problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: decode, base64 problem
Дата
Msg-id 29545.1590163033@sss.pgh.pa.us
обсуждение исходный текст
Ответ на decode, base64 problem  (gmail Vladimir Koković <vladimir.kokovic@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: gmail Vladimir Koković
Дата:
Сообщение: decode, base64 problem
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: decode, base64 problem