Re: does encrypt function support higher than basic ascii?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: does encrypt function support higher than basic ascii?
Дата
Msg-id 4B03108D.60707@archonet.com
обсуждение исходный текст
Ответ на Re: does encrypt function support higher than basic ascii?  ("Naoko Reeves" <naoko@lawlogix.com>)
Ответы Re: does encrypt function support higher than basic ascii?  ("Naoko Reeves" <naoko@lawlogix.com>)
Список pgsql-general
Naoko Reeves wrote:
> Sorry, as Richard said the issue was me not converting bytea to text. The blow did it . thank you!
>
> SELECT convert_from((select decrypt(encrypt((select convert('aéiou','LATIN1',
'LATIN1')),'foo','aes'),'foo','aes')),'UNICODE')

I'm surprised you can't just do:

SELECT convert_from(
  decrypt(
    encrypt( 'aéiou'::bytea, 'foo', 'aes' )
    , 'foo', 'aes'
  )
  , 'unicode'
)

You should be able to cast to bytea simply enough. Coming back the other
way, you do need to tell it what encoding you have through convert_from().

--
  Richard Huxton
  Archonet Ltd

В списке pgsql-general по дате отправления:

Предыдущее
От: "Naoko Reeves"
Дата:
Сообщение: Re: does encrypt function support higher than basic ascii?
Следующее
От: "Naoko Reeves"
Дата:
Сообщение: Re: does encrypt function support higher than basic ascii?