i need decode sender from uts 8 and base 64 in python

You can use the base64 module and the decode function to decode a base64 string. To decode a utf-8 string, you can use the decode function on the bytes object after decoding from base64.

Here's an example code snippet:

main.py
import base64

encoded_string = "SGVsbG8gV29ybGQh"
base64_bytes = encoded_string.encode('utf-8')
message_bytes = base64.b64decode(base64_bytes)
decoded_message = message_bytes.decode('utf-8')

print(decoded_message)
216 chars
9 lines

This should output Hello World!. The encode function is used to convert the string to a bytes object. The base64-encoded string is then decoded using the b64decode function from the base64 module, and the resulting bytes are decoded using the decode function with the utf-8 encoding.

related categories

gistlibby LogSnag