<div dir="ltr"><div><div>Hi, <br></div>I'm going through the documentation and came across the following error:<br><br></div>in <a href="http://docs.python.org/2.7/tutorial/interpreter.html">http://docs.python.org/2.7/tutorial/interpreter.html</a>, in the Source Encoding Section, there is a program:<br>
<br><pre><span class=""># -*- coding: iso-8859-15 -*-</span>

<span class="">currency</span> <span class="">=</span> <span class="">u"€"</span>
<span class="">print</span> <span class="">ord</span><span class="">(</span><span class="">currency</span><span class="">)<br><br></span></pre><pre><span class="">which presents a problem when running:<br><br><br>Traceback (most recent call last):<br>
  File "encoding.py", line 6, in <module><br>    print ord(currency)<br>TypeError: ord() expected a character, but string of length 3 found<br><br></span></pre><pre><span class="">but if I change the encoding to UTF-8 it works:<br>
<br># -*- coding: UTF -*-<br><br></span></pre><pre><span class="">it give the desired results. Not sure if it is a real bug.<br></span></pre><pre><span class=""><br></span></pre><pre><span class="">Regards, <br></span></pre>
<pre><span class="">bm<br></span></pre></div>