chinaunix网友2007-11-19 15:57
你好! 我遇到支持多国语言软件的问题,好像你也曾经遇到过请问是怎么解决的。谢谢! 以下是你之前的提问。 我设法是程序显示中文,但执行后的信息为: unable to translate from None to utf-8: argument 2 must be string, not None Traceback (most recent call last): File "./language_tr.py", line 9, in ? print _("Hello World!\n") File "/usr/lib/python2.3/site-packages/rhpl/translate.py", line 200, in gettext return translation.encode("UTF-8") UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128) 何解? 程序代码很简单,如下 #!/usr/bin/python ##### coding : utf-8 from rhpl.translate import N_, _ from rhpl.translate import * textdomain("LLLL") print _("Hello World!\n") print _("LLLL") 剩下的就是写个po文件生成mo文件 LLLL.mo 请哪位高手给指导一下! 我的联系方式: jinlincaowei@163.com