title: Converting utf-8 to latin-1 in Python
body: <p>I want to do this:</p>
  
  <p>Take the bytes of this utf-8 string:</p>
  
  <p>访视频</p>
  
  <p>Encode those bytes in latin-1 and print the result:</p>
  
  <p>è®¿è§†é¢‘</p>
  
  <p>How do I do this in Python?</p>
  
  <pre><code># -*- coding: utf-8
  s = u'访视频'.encode('latin-1')
  </code></pre>
  
  <p>Causes this exception:</p>
  
  <pre><code>s = u'访视频'.encode('latin-1')
  UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-2: ordinal not in range(256)
  </code></pre>