Issue 289 in ulipad: 还是中文编码的问题

40 views
Skip to first unread message

uli...@googlecode.com

unread,
Feb 13, 2012, 10:58:08 PM2/13/12
to uli...@googlegroups.com
Status: New
Owner: ----

New issue 289 by helloar...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

我用Ulipad4.1新建一个py的文档
代码如下:
#! /usr/bin/env python
#coding=utf-8
print '哈哈'
点击运行的时候就会出现乱码
但是我把codeing改成GBK的时候,就会显示正常的中文,
这是为什么呀?
我用editplus看过这个保存的文件,保存的编码是UTF-8的,求大侠解答一下呀!


Attachments:
py1.jpg 21.1 KB
py2.jpg 12.0 KB

uli...@googlecode.com

unread,
Feb 13, 2012, 11:44:29 PM2/13/12
to uli...@googlegroups.com

Comment #1 on issue 289 by zhangchu...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

汗...就是因为是 utf-8 的所以才会乱码阿,这个是正常的阿
想要在中文windows下打印中文,还是要用 gb 码吧

uli...@googlecode.com

unread,
Feb 13, 2012, 11:58:35 PM2/13/12
to uli...@googlegroups.com

Comment #2 on issue 289 by helloar...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

那如果我数据库是UTF-8的怎么办?

uli...@googlecode.com

unread,
Feb 14, 2012, 12:02:36 AM2/14/12
to uli...@googlegroups.com

Comment #3 on issue 289 by helloar...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

还有,按理说UTF-8是应该支持中文的吧

uli...@googlecode.com

unread,
Feb 14, 2012, 12:06:36 AM2/14/12
to uli...@googlegroups.com
Updates:
Status: Invalid

Comment #4 on issue 289 by limo...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

是支持的,但是控制台也有自已的编码,只有编码一致时显示才是正常的。所以在命令
行输出,在中文环境下一般要么使用unicode输出,要么使用gbk。其它的环境根据情况
来输出。

uli...@googlecode.com

unread,
Feb 14, 2012, 12:23:43 AM2/14/12
to uli...@googlegroups.com

Comment #5 on issue 289 by helloar...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

额,谢谢大家,我试试吧!

uli...@googlecode.com

unread,
Feb 14, 2012, 1:47:12 AM2/14/12
to uli...@googlegroups.com

Comment #6 on issue 289 by helloar...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

print u'你好'
前面加U的话会出错误的
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1:
ordinal not in range(128)

uli...@googlecode.com

unread,
Feb 14, 2012, 6:17:12 AM2/14/12
to uli...@googlegroups.com

Comment #7 on issue 289 by limo...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

直接在ulipad中运行是通过管道来获取的,直接输出unicode会报错。要么直接在命令
行下运行,要么转为gbk在ulipad中运行。

uli...@googlecode.com

unread,
Oct 8, 2013, 4:40:17 AM10/8/13
to uli...@googlegroups.com

Comment #8 on issue 289 by hesiyuan...@gmail.com: 还是中文编码的问题
http://code.google.com/p/ulipad/issues/detail?id=289

failed to install in my windows xp sp3 OS .but successed in my win7

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages