Python Detect String Encoding And Decoding Definition