google-code-export / ulipad

Automatically exported from code.google.com/p/ulipad
0 stars 0 forks source link

在 Ulipad 中,print 中文 string 与在命令行方式下不一致 #285

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. 在Windows 下进入命令行模式,输入 python 进入 python 环境
2. 输入 keyword = ‘google 一下,你就知道’,回车
3. 输入 keyword,回车;输出 
'google\xd2\xbb\xcf\xc2\xa3\xac\xc4\xe3\xbe\xcd\xd6\xaa\xb5\xc0'
4. 输入 keyword2 = u‘google 一下,你就知道’,回车
5. 输入 keyword2,回车;输出 
u'google\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053'
6. 输入 print keyword, keyword2,输出 google一下,你就知道 
google一下,你就知道
7. 但是在 ulipad 中输入同样的命令时,直接输入 keyword 
没有输出任何内容;而输入 print keyword 
时输出的是:'google\xd2\xbb\xcf\xc2\xa3\xac\xc4\xe3\xbe\xcd\xd6\xaa\xb5\xc
0'

p.s: python 2.7.2 环境,已经修改了 site.py 文件,并在 
sitecustomize.py 中指定了缺省encoding 为 UTF-8. 在ulipad 
中,也在代码第一行指定了 #coding=utf-8.

Original issue reported on code.google.com by jackeichan@gmail.com on 3 Dec 2011 at 4:25