Python Detect String Encoding And Decoding Activities