Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I have a string like \314\002\012\001 which I need to convert into a base64 encoded byte string.

share|improve this question
    
Are you using a binary data type in the database? – Tom Shaw May 27 '11 at 2:24
    
Yes, it is a bytea column. – Keyo May 27 '11 at 2:25
up vote 2 down vote accepted

You should be able to use the built-in php function pg_unescape_bytea. There is an example on that page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.