根据示例,发现回复的信息显示为:
if recMsg.Eventkey == 'mpGuide':
content = u"编写中,尚未完成".encode('utf-8')
replyMsg = reply.TextMsg(toUser, fromUser, content)
return replyMsg.send()
def send(self):
XmlForm = """
<xml>
<ToUserName><![CDATA[{ToUserName}]]></ToUserName>
<FromUserName><![CDATA[{FromUserName}]]></FromUserName>
<CreateTime>{CreateTime}</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[{Content}]]></Content>
</xml>
"""
return XmlForm.format(**self.__dict)
具体应该如何设置中文的编码?
response = u'hello world'
utf8_response = response.encode('utf-8')
print(utf8_response)
转化成UTF-8
我都不搞python,自己都能百度解决。现在不方便找,你都试的啥?