I am using python 2.4 on Ubuntu dapper, I am working through Dive into
Python.
There are a couple of inconsictencies .
Firstly sys.setdefaulte ncoding('iso− 8859−1') does not work,I have to do
sys.setdefaulte ncoding = 'iso−8859−1 '
secondly the following does not give a 'UnicodeError: ASCII encoding
error:', and I would expect ti to. In fact it prints out the n with ~
above it fine:
sys.setdefaulte ncoding = 'ascii'
s = u'La Pe\xf1a'
print s
Any insight?
Ben
Python.
There are a couple of inconsictencies .
Firstly sys.setdefaulte ncoding('iso− 8859−1') does not work,I have to do
sys.setdefaulte ncoding = 'iso−8859−1 '
secondly the following does not give a 'UnicodeError: ASCII encoding
error:', and I would expect ti to. In fact it prints out the n with ~
above it fine:
sys.setdefaulte ncoding = 'ascii'
s = u'La Pe\xf1a'
print s
Any insight?
Ben
Comment