2004年05月24日 星期一 15:02
info,您好! 一样。只要是unicode的wxPython,在源代码中都要先转一下。如果直接从控件中得到的字符串,因为已经是unicode的了,就不用转了。保存时应注意转回原来的编码。 ======= 2004-05-24 14:03:13 您在来信中写道:======= >limodou,您好! > > 谢谢了,如果是菜单上的中文,如何操作呢? > >======= 2004-05-24 13:01:33 您在来信中写道:======= > >>info,您好! >> >> 如果使用unicode版本的话,首先根据文件的编码方式转成unicode,然后再加入到wxPython中即可。如,使用cp936编码(简体中文windows的缺省编码方式),可以: >>text=open(filename, 'rb').read() >>s = unicode(text, 'cp936') >>再将s插入到编辑器中即可。 >>如果已经知道文件为utf-8编码,可以 >>text=open(filename, 'rb').read() >>s = unicode(text, 'utf-8') >> >>======= 2004-05-24 10:30:39 您在来信中写道:======= >> >>>python-chinese,您好! >>> 我使用的是freebsd4.8的系统+kde3.1,在kde下能正确显示中文和繁体字。通过内置的编辑工具也能以gb18030、gb2312和utf-8方式查看代码中的中文,但是用utf-8方式查看源文件显示为乱码。 >>> >>> >>> 致 >>>礼! >>> >>> >>> info >>> info at xichen.com >>> 2004-05-24 >>>_______________________________________________ >>>python-chinese list >>>python-chinese at lists.python.cn >>>http://python.cn/mailman/listinfo/python-chinese >>> >> >>= = = = = = = = = = = = = = = = = = = = >> >> >> 致 >>礼! >> >> >> limodou >> chatme at 263.net >> 2004-05-24 >> >>_______________________________________________ >>python-chinese list >>python-chinese at lists.python.cn >>http://python.cn/mailman/listinfo/python-chinese >> > >= = = = = = = = = = = = = = = = = = = = > > > 致 >礼! > > > info > info at xichen.com > 2004-05-24 > >_______________________________________________ >python-chinese list >python-chinese at lists.python.cn >http://python.cn/mailman/listinfo/python-chinese > = = = = = = = = = = = = = = = = = = = = 致 礼! limodou chatme at 263.net 2004-05-24
Zeuux © 2024
京ICP备05028076号