decode double slash octal

From: Weiss, Jörg <J(dot)Weiss(at)dvz-mv(dot)de>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: decode double slash octal
Date: 2015-07-09 06:29:59
Message-ID: 4B4E89127868BD458A795430BCF4FD1328DAB263@DVZSN-RA0325.bk.dvz-mv.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Weiss 2015-07-09 09:21:36 Octal to UTF-8
Previous Message John R Pierce 2015-07-08 19:20:37 Re: [SQL] encrypt psql password in unix script