java模拟的客户端发送url中的参数给struts2服务器,为什么控制台打印和存入数据库中文都是乱码?

java模拟的客户端发送url中的参数给struts2服务器,为什么控制台打印和存入数据库中文都是乱码?,第1张

"apid=11100&ssid="+URLEncoder.encode(“你我”,"gbk")+"&bssid=last&mapid=12&x=1000&y=11"

需要对url参数进行转码;

try:

fh = open("testfile", "w")

fh.write("This is my test file for exception handling!!")

except IOError:

print "Error: can\'t find file or read data"

else:

print "Written content in the file successfully"

fh.close()


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/sjk/9684225.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-30
下一篇 2023-04-30

发表评论

登录后才能评论

评论列表(0条)

保存