关于支付宝生活号的事件通知gbk转码问题
发布于 6 年前 作者 BrotherPeng 2137 次浏览 来自 问答

sign=hzrLp0FanpUxWuFDp%2BNTwiMzYBguBxneEadFeyD1ikLl5oBtLF69JDN1%2FZQsa%2BJl%2FneoqT8q%2BEVaF5Wr3hRKuJnZtKMCZsIMwelmBfkAf0vobPy5BsgLNtBlc79xiOxO3SAmgrW03GLeiqkkqBMVO%2FmTy3sLK4eF%2B%2FcmdNlJrxr8CxRrNvFostwy8m5uYD0ryK7zaYxxrWvK3dKwxmdgitJaw0W7nxtPhukP1Q8LSPHKo5W6K7%2Bj%2BHNo%2FliWlExtiluoSSD3FsUAqdDD0Ql8i344N74vkGFDwgsQNZ94lm52vFrqgdw3hWnIeCGJjEu3DVCTXa6JFTH1Sx7U4cUKUw%3D%3D&charset=GBK&biz_content=%3CXML%3E%3CEventType%3E%3C%21%5BCDATA%5Bunfollow%5D%5D%3E%3C%2FEventType%3E%3CActionParam%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2FActionParam%3E%3CFromAlipayUserId%3E%3C%21%5BCDATA%5B20886073%5D%5D%3E%3C%2FFromAlipayUserId%3E%3CAppId%3E%3C%21%5BCDATA%5B201806202%5D%5D%3E%3C%2FAppId%3E%3CMsgType%3E%3C%21%5BCDATA%5Bevent%5D%5D%3E%3C%2FMsgType%3E%3CCreateTime%3E%3C%21%5BCDATA%5B1535631075929%5D%5D%3E%3C%2FCreateTime%3E%3CFromUserId%3E%3C%21%5BCDATA%5B208800056313400%5D%5D%3E%3C%2FFromUserId%3E%3CMsgId%3E%3C%21%5BCDATA%5B545cfb058f774cd98c1dfca2b5ef9343%5D%5D%3E%3C%2FMsgId%3E%3CAccountNo%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2FAccountNo%3E%3CAgreementId%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2FAgreementId%3E%3CUserInfo%3E%3C%21%5BCDATA%5B%7B%22logon_id%22%3A%22979**%40qq.com%22%2C%22user_name%22%3A%22*%D4%C6%C5%F4%22%7D%5D%5D%3E%3C%2FUserInfo%3E%3C%2FXML%3E&sign_type=RSA2&service=alipay.mobile.public.message.notify

有以上这么一段事件消息,我总是验签不通过,而且querystring.parse的时候user_name的中文是乱码,各位可不可以帮我用什么函数转换一下呢 new Iconv(‘GBK’,‘UTF-8’).convert(decodeStr).toString() 似乎不起作用,不知道我是不是使用方式不对

4 回复

你的思路错了,支付宝接入是可以直接支持UTF 的,就是方式比较隐蔽,我也折腾了一段时间。。。。。

@cnlile 不是的,我问了客服的,通知过来的数据就是GBK编码,我现在转换比较费劲,老乱码

@cnlile 你的问题是怎么解决的呢

回到顶部