I want to adapt a code written for python3 to python2.7 while doing so I am getting errors because of the this two
bytes(some_string, 'UTF-8') and str(some_string, 'UTF-8')
My Question:
Is following a correct way to adapt str(some_string, 'UTF-8')
a = str(some_string)
a = a.encode('UTF-8')
and how to adapt bytes(some_string, 'UTF-8') to python2.7 as bytes are introduced in python3.