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