[issue1092] Unexpected results in Tutorial about Unicode

Vizcaynot report at bugs.python.org
Mon Sep 3 05:36:47 CEST 2007


New submission from Vizcaynot:

When trying the tutorial example about unicode  I have:
>>> "Äpfel".encode('utf-8')
  File "<stdin>", line 1
SyntaxError: (unicode error) unexpected code byte

I live in a latin american country so I need to do:
>>> "Äpfel".decode('latin-1).encode('utf-8')
  File "<stdin>", line 1
    >>>
but the indentation "     >>>" is new for me, so I attempt the next:
>>> a="Äpfel".decode('latin-1).encode('utf-8')
  File "<stdin>", line 1
    >>> a
b'\xc3\x84pfel'
>>> print (a)
Äpfel
>>>

Is this necessary to do correction to the tutorial? is this normal the 
presence of "   >>>" that appears indented once I assign the value to 
variable a?
Thanks!!

----------
components: Unicode
messages: 55598
nosy: Viscaynot
severity: normal
status: open
title: Unexpected results in Tutorial about Unicode
type: behavior
versions: Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1092>
__________________________________


More information about the Python-bugs-list mailing list