Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help 

Is there an equivalent of Encode in PERL written in Python?

I recently re-discovered rc1342 and how well spoofing can be done with it, sometimes even bypassing e-mail security sandboxes.
Only problem is, im very much a novice with Python having written only a few simple scripts working with various APIs so simple stuff with documentation.
Encode in PERL can automatically encode each MIME header with the required set and I couldn't find a simple tool that does all that for the life of me and my attempts at coding this in Python have failed.
To add detail to this I basically need a tool that can encode text into various charsets such as ISO-8859-X
In Python, you can use the encode() method of a string object to work with ISO-8859-X encoded text. For example, to use an ISO-8859-1 encoded document, you need the following code:
Code
text = "Hello, world!"
encoded_text = text.encode("ISO-8859-1")

You can use the decode() method to decode a string from an ISO-8859-X encoding to Unicode. For example:
Code
encoded_text = b"Hello, world!"
text = encoded_text.decode("ISO-8859-1")


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Assembly] by RobotCrackFeb 25, 2017 02:43 PM 5 284 Feb 25, 2017 02:43 PM
Last Post: electricalengineering
by cortland12Apr 25, 2016 11:36 AM 2 100 Apr 25, 2016 11:36 AM
Last Post: cortland12
[Assembly] by SIM-1866423Apr 10, 2015 11:30 PM 2 204 Apr 10, 2015 11:30 PM
Last Post: SIM-1866423