0

I've been using python from time to time for some small projects and just started using it again after quite a while. I'm using Enthoughts Canopy IDE and get the following error:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)

I know that I have to define the encoding first and I do so in the 2nd Line:

" # -- coding: utf-8 -- "

but when I run the script within Canopy I keep getting the error whenever I enter one of the following letters: ä,ö,ü as user input When I start my script via console ("python XXX.py" or "ipython XXX.py") it works like a charm .

I'm just a little confused since I thought Canopy uses the ipython interpreter so there shouldn't be any differences whether I start it from console as ipython or via canopy

best regards

4

1 回答 1

1

您是否从未保存的缓冲区运行此代码?如果是,这是 Canopy 1.0 中的一个已知问题,应该在下一次更新中修复。如果不是,您能否提供一个最小示例来重现您的问题,以便解决?谢谢!

于 2013-06-04T09:02:32.057 回答