小编jac*_*cob的帖子

python unichr问题

unichr()我的服务器上遇到了一些问题.请看下面:

在我的服务器上(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)
Run Code Online (Sandbox Code Playgroud)

在我的桌面上(Ubuntu 9.10):

>>> print unichr(255)
ÿ
Run Code Online (Sandbox Code Playgroud)

我是python的新手,所以我不知道如何解决这个问题.有人在乎帮忙吗?谢谢.

python unicode ubuntu

2
推荐指数
1
解决办法
3130
查看次数

标签 统计

python ×1

ubuntu ×1

unicode ×1