python unichr problem

Posted by jacob on Stack Overflow See other posts from Stack Overflow or by jacob
Published on 2010-04-06T08:07:31Z Indexed on 2010/04/06 8:13 UTC
Read the original article Hit count: 340

Filed under:
|
|

I've got some problem with unichr() on my server. Please see below:

On my server (Ubuntu 9.04):

>>> print unichr(255)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xff' in position 0: ordinal not in range(128)

On my desktop (Ubuntu 9.10):

>>> print unichr(255)
ÿ

I'm fairly new to python so I don't know how to solve this. Anyone care to help? Thanks.

© Stack Overflow or respective owner

Related posts about python

Related posts about unicode