答复: 答复: 关于打印乱码问 题,请教
"Handle.Huang" <[email protected]> Sun, 20 Jan 2008 20:51:44 +0800
| Newsgroups | gmane.comp.python.chinese |
|---|---|
| Message-ID | <[email protected]> |
直接在cmd中运行呢? 发件人: [email protected] [mailto:[email protected]] 代表 gary.jsz 发送时间: 2008年1月20日 20:47 收件人: [email protected] 主题: Re: [python-chinese] 答复: 关于打印乱码问题,请教 我是使用Ulipad直接运行的,运行结果就是这个。 如果我使用utf8的话,所有的输出都无法显示中文,使用gb2312还只是直接打印的会这 样。 _____ 发件人: 大郎 发送时间: 2008-01-20 19:00:04 收件人: [email protected] 抄送: 主题: Re: [python-chinese]答复: 关于打印乱码问题,请教 据我的经验是当前文件使用utf-8编码,不会出现问题,不知你是在命令行下还是web 下? On 1/20/08, gary.jsz <[email protected]> wrote: 有什么方法可以让他直接打印中文嘛? _____ 发件人: Handle.Huang 发送时间: 2008-01-20 16:52:10 收件人: [email protected] 抄送: 主题: [python-chinese] 答复: 关于打印乱码问题,请教 Python内部都是按照Uncode来处理的。 发件人: [email protected] [mailto:[email protected]] 代表 gary.jsz 发送时间: 2008年1月20日 16:36 收件人: [email protected] 主题: [python-chinese] 关于打印乱码问题,请教 代码如下: #-*-coding=gb2312-*- d1 = {1:'中国人 ', 2:'中国龙',3:'龙芯 CPU', 4:'巨蟒'} print d1 for i in d1.keys(): print i, '\t' ,d1[i] y = len(d1) print y 为何只答应d1的时候是下面的这些字符,而佚代后确打印正常,请问为什么? 结果如下: {1: '\xd6\xd0\xb9\xfa\xc8\xcb', 2: '\xd6\xd0\xb9\xfa\xc1\xfa', 3: '\xc1\xfa\xd0\xbeCPU', 4: '\xbe\xde\xf2\xfe'} 1 中国人 2 中国龙 3 龙芯CPU 4 巨蟒 4 _______________________________________________ python-chinese Post: send [email protected] Subscribe: send subscribe to [email protected] Unsubscribe: send unsubscribe to [email protected] Detail Info: http://python.cn/mailman/listinfo/python-chinese -- http://del.icio.us/iexper http://twitter.com/qichangxing <http://twitter.com/qichangxing> http://webpy.org http://blog.hi0791.com (build with web.py) http://www.baicai.com 百才招聘 Gtalk: iexper(at)gmail.com _______________________________________________ python-chinese Post: send [email protected] Subscribe: send subscribe to [email protected] Unsubscribe: send unsubscribe to [email protected] Detail Info: http://python.cn/mailman/listinfo/python-chinese