decode double slash octal - Mailing list pgsql-sql

From Weiss, Jörg
Subject decode double slash octal
Date
Msg-id 4B4E89127868BD458A795430BCF4FD1328DAB263@DVZSN-RA0325.bk.dvz-mv.net
Whole thread
List pgsql-sql

Hi!

 

I use pgcrypto encrypt_iv and decrypt_iv to crypt and decrapt data. The data is stored in an bytea field.

 

To encrypt I use this SQL for example:  encrypt_iv(‘Bärbel’, 'MyPassword', decode('Tn5Tuxy7x9NWBybEcUvKBQ==', 'base64'), 'aes')

 

To decrypt I use this SQL: encode(decrypt_iv(nachname, MyPassword ', decode(iv, 'base64'), 'aes'), 'escape')

 

When I decrypt the field nachname in PostgreSQL 8.1 it returns the correct german word “Bärbel”.

 

When I do it the same way in PostgreSQL 9.3 I got this “B\\303\\244rbel”. The geman UTF-8 letters are escaped, octal-encoded letters.

 

How can I decode “B\\303\\244rbel” to “Bärbel”? I find no solution for this problem.

 

Regards

pgsql-sql by date:

Previous
From: Xavier Stevens
Date:
Subject: Re: [GENERAL] encrypt psql password in unix script
Next
From: Weiss, Jörg
Date:
Subject: Octal to UTF-8