title: Unable to encode/decode pprint output
body: <p>This question is based on a side-effect of <a href="https://stackoverflow.com/q/10881326/257972">that one</a>.</p>
  
  <p>My <code>.py</code> files are all have <code># -*- coding: utf-8 -*-</code> encoding definer on the first line, like my <code>api.py</code></p>
  
  <p>As I mention on the related question, I use <code>HttpResponse</code> to return the api documentation. Since I defined encoding by:</p>
  
  <pre><code>HttpResponse(cy_content, content_type='text/plain; charset=utf-8')
  </code></pre>
  
  <p>Everything is ok, and when I call my API service, there are no encoding problems except <em>the string formed from a dictionary by pprint</em> </p>
  
  <p>Since I am using Turkish characters in some values in my dict, pprint converts them to <code>unichr</code> equivalents, like:</p>
  
  <pre><code>API_STATUS = {
      1: 'müşteri',
      2: 'some other status message'
  }
  
  my_str = 'Here is the documentation part that contains Turkish chars like işüğçö'
  my_str += pprint.pformat(API_STATUS, indent=4, width=1)
  return HttpRespopnse(my_str, content_type='text/plain; charset=utf-8')
  </code></pre>
  
  <p>And my plain text output is like:</p>
  
  <pre><code>Here is the documentation part that contains Turkish chars like işüğçö
  
  {
      1: 'm\xc3\xbc\xc5\x9fteri',
      2: 'some other status message'
  }
  </code></pre>
  
  <p>I try to decode or encode pprint output to different encodings, with no success... What is the best practice to overcome this problem </p>