title: Why web-server complains about Cyrillic letters and command line not?
body: <p>I have a web-server on which I try to submit a form containing Cyrillic letters. As a result I get the following error message:</p>
  
  <pre><code>UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)
  </code></pre>
  
  <p>This message comes from the following line of the code:</p>
  
  <pre><code>ups = 'rrr {0}'.format(body.replace("'","''"))
  </code></pre>
  
  <p>(<code>body</code> contains Cyrillic letters). Strangely I cannot reproduce this error message in the python command line. The following works fine:</p>
  
  <pre><code>&gt;&gt;&gt; body = 'ппп'
  &gt;&gt;&gt; ups = 'rrr {0}'.format(body.replace("'","''"))
  </code></pre>