Created
December 14, 2017 15:26
-
-
Save decidedlygray/a037a52ead8652dc2887358081ab11cd to your computer and use it in GitHub Desktop.
Python2 snippet for taking a base64-encoded unicode string, and decoding it properly so there aren't trailing null bytes on ASCII characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Python2 snippet for taking a base64-encoded unicode string, decoding it | |
properly so there aren't trailing null bytes for ASCII characters | |
Leaving this here so I don't have to look it up again | |
@decidedlygray | |
""" | |
import base64 | |
b64_str = "ADD BASE64 UNICODE STRING HERE" | |
b64_str_decoded = base64.b64decode(b64_str).decode('UTF-16') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment