I have tried solving the UnicodeDecodeError, UnicodeEncodeError for Python2 environment. Have a look at the changes and let me know if the changes are helpful. @maxking @msapiro