title: Python unicode works in 2.6.1 on OSX, but not in 2.6.5 on Ubuntu
body: <p>Given the following code run from the Python interpreter:</p>
  
  <pre><code>import sys
  sys.getdefaultencoding()
  my_string = '\xc3\xa9'
  my_string = unicode(my_string, 'utf-8')
  my_string
  print my_string
  </code></pre>
  
  <p>With Python 2.6.1 running on a mac, everything works fine:</p>
  
  <pre><code>$ python
  Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
  [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import sys
  &gt;&gt;&gt; sys.getdefaultencoding()
  'ascii'
  &gt;&gt;&gt; my_string = '\xc3\xa9'
  &gt;&gt;&gt; my_string = unicode(my_string, 'utf-8')
  &gt;&gt;&gt; my_string
  u'\xe9'
  &gt;&gt;&gt; print my_string
  é
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>With Python 2.6.5 running on Ubuntu 10.04 LTS, it fails:</p>
  
  <pre><code>$ python
  Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
  [GCC 4.4.3] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import sys
  &gt;&gt;&gt; sys.getdefaultencoding()
  'ascii'
  &gt;&gt;&gt; my_string = '\xc3\xa9'
  &gt;&gt;&gt; my_string = unicode(my_string, 'utf-8')
  &gt;&gt;&gt; my_string
  u'\xe9'
  &gt;&gt;&gt; print my_string
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 0: ordinal not in range(128)
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>Has something changed between Python 2.6.1 and 2.6.5 that requires different handling of unicode strings? Or does this have to do with something misconfigured in my (default Ubuntu server 10.04 LTS) linux environment?</p>
  
  <p>Edit: Both environments have LANG=en_US.UTF-8</p>