0

I have a string "some_string" which has been encoded in below way and returns encoded value "some_encoded_value" :

select utl_encode.base64_encode(utl_raw.cast_to_raw('some_string')) from dual;

I want to decode it in python2.7 but I am unable to do so.

I am trying to do it in the following way :

base64.b64decode("some_encoded_value")

Output of this python returns some characters like which dont look like normal string

\xe4\x5t\xe6\x7e..... etc

Can you please let help me out in this.

All i have been able to figure out it is we might need something similar to cast_to_var2 in python but I am unable to find it.

1 Answer 1

0

You first snippet calls two functions...

utl_encode.base64_encode(utl_raw.cast_to_raw('some_string'))

Your second snippet calls the reverse of one of those two functions...

You need to reverse both of them...

UTL_RAW.CAST_TO_VARCHAR2(utl_encode.base_64decode("some_encoded_value"))

Manual :

Or, to convert binary to string in python...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.