B
Ben Edwards (lists)
I am using python 2.4 on Ubuntu dapper, I am working through Dive into
Python.
There are a couple of inconsictencies.
Firstly sys.setdefaultencoding('iso−8859−1') does not work, I have to do
sys.setdefaultencoding = '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.setdefaultencoding = 'ascii'
s = u'La Pe\xf1a'
print s
Any insight?
Ben
Python.
There are a couple of inconsictencies.
Firstly sys.setdefaultencoding('iso−8859−1') does not work, I have to do
sys.setdefaultencoding = '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.setdefaultencoding = 'ascii'
s = u'La Pe\xf1a'
print s
Any insight?
Ben