Joel Goldstick wrote:
> I was reading this: http://diveintopython.org/xml_processing/unicode.html
>
> and tried the exercise:
>
s = u'La Pe\xf1a' [image: 1]
print s [image: 2]
> Traceback (innermost last):
> File "", line 1, in ?
> UnicodeError: ASCII encodi
On Fri, Jul 30, 2010 at 1:33 PM, Joel Goldstick wrote:
> I was reading this: http://diveintopython.org/xml_processing/unicode.html
>
> and tried the exercise:
>
> But oddly enough, when I typed it into my python shell I did NOT get the
> UnicodeError, and I wonder why not:
>
I believe that pyth
I was reading this: http://diveintopython.org/xml_processing/unicode.html
and tried the exercise:
>>> s = u'La Pe\xf1a'
>>> print s
Traceback (innermost last):
File "", line 1, in ?
UnicodeError: ASCII encoding error: ordinal not in range(128)
>>> print s.encode('latin-1')
La Peña
But oddl
I was reading this: http://diveintopython.org/xml_processing/unicode.html
and tried the exercise:
>>> s = u'La Pe\xf1a' [image: 1]
>>> print s [image: 2]
Traceback (innermost last):
File "", line 1, in ?
UnicodeError: ASCII encoding error: ordinal not in range(128)
>>>