每一个,我都试图通过python发送短信,我可以发送它,但我需要发送中文,这是big5,我必须解码utf8到big5,这是我的短信python代码
trydecode.py
import urllib
import urllib2
def sendsms(phonenumber,textcontent):
textcontent.decode('utf8').encode('big5')
url = "https://url?username=myname&password=mypassword&dstaddr="+phonenumber+"&smbody="+textcontent
req = urllib2.Request(url)
response = urllib2.urlopen(req)
这段代码(python2.7)我可以用英文发短信但是中文(big5)有问题,我该怎么办呢?谢谢
答案 0 :(得分:3)
我认为您忘记保存它以更改变量。
require 'nokogumbo'
doc = Nokogiri::HTML5.get(uri)