title: String .format() vs. % formatting with Unicode data
body: <p>With</p>
  
  <pre><code>print("    {:d}). {:s} ({:d})".format(i, account, num_char))
  </code></pre>
  
  <p>I get the error:  </p>
  
  <pre><code>UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)
  </code></pre>
  
  <p>but when I change it to:  </p>
  
  <pre><code>print "    %d). %s (%d)" % (i, account, num_char)
  </code></pre>
  
  <p>then there are no problem and output is identical with both prints.</p>
  
  <p>So what is wrong in the first expression and why does it work in the second?</p>