google-code-export / ulipad

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

还是中文编码的问题 #289

Closed GoogleCodeExporter closed 9 years ago

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

Original issue reported on code.google.com by helloar...@gmail.com on 14 Feb 2012 at 3:57

Attachments:

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

Original comment by zhangchu...@gmail.com on 14 Feb 2012 at 4:43

GoogleCodeExporter commented 9 years ago
那如果我数据库是UTF-8的怎么办?

Original comment by helloar...@gmail.com on 14 Feb 2012 at 4:57

GoogleCodeExporter commented 9 years ago
还有,按理说UTF-8是应该支持中文的吧

Original comment by helloar...@gmail.com on 14 Feb 2012 at 4:59

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

Original comment by limo...@gmail.com on 14 Feb 2012 at 5:04

GoogleCodeExporter commented 9 years ago
额,谢谢大家,我试试吧!

Original comment by helloar...@gmail.com on 14 Feb 2012 at 5:23

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

Original comment by helloar...@gmail.com on 14 Feb 2012 at 6:46

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

Original comment by limo...@gmail.com on 14 Feb 2012 at 11:16

GoogleCodeExporter commented 9 years ago
failed to install in my windows xp sp3  OS .but successed  in my win7

Original comment by hesiyuan...@gmail.com on 8 Oct 2013 at 8:40