title: using extended Ascii codes with Python
body: <p>I've created a dictionnary with Python but I've got problems with extended Ascii codes.</p>
  
  <p>The loop that creats the dictionnary is : (ascii number 128 to 164 : é,à etc)</p>
  
  <pre><code>#extented ascii codes
  i = 128
  while i &lt;= 165 :
      dictionnary[chr(i)] = 'extended ascii'
      i = i + 1
  </code></pre>
  
  <p>But when I try to use dictionnary :</p>
  
  <pre><code>    &gt;&gt;&gt; dictionnary['è']
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  KeyError: '\xc3\xa8'
  </code></pre>
  
  <p>I've got # -<em>- coding: utf-8 -</em>- in the header of the python script.
  I've tried encode,decode etc but the result is always bad.</p>
  
  <p>To understand what happens, I've tried :</p>
  
  <pre><code>&gt;&gt;&gt; ord('é')
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: ord() expected a character, but string of length 2 found
  </code></pre>
  
  <p>and </p>
  
  <pre><code>    &gt;&gt;&gt; ord(u'é')
  233
  </code></pre>
  
  <p>I'am confused with ord(u'é') because 'é' is number 130 in extended ascii table and not 233.</p>
  
  <p>I understand that extended ascii codes contains "two characters" but I don't understand how to solve the problem with dictionnary ?</p>
  
  <p>Thanks in advance !
  :-)</p>