服务器微信接口返回乱码,企业微信会话内容存档调用DecryptData返回中文出现乱码...

企业微信会话内容存档调用DecryptData返回中文出现乱码

问题类型 API/组件名称 终端类型 微信版本 基础库版本 Bug 企业微信会话存档sdk 工具 无 无

我用c#开发会话存档功能,调用官方c的dll,使用解密方法DecryptData返回msg,再调用GetContentFromSlice(msg)出现部分中文乱码。

双数中文字的时候不会乱码,例:“您好”。单数中文字的时候最后一个字是乱码,例:“麻烦提供下截�?”,(原文:麻烦提供下截图)。

而且乱码的那条数据最后的双引号也没有返回,导致不能正常转成json格式,如下图:

2e08e7c8c32e2e63361c07a0ddeddb7d.png

之前开发了个java的版本,一切正常可以返回正常的中文数据。

同一条会话数据,用java中运行出来的encrypt_key、encrypt_msg和c#运行出来的encrypt_key、encrypt_msg一致,但是c#调用解密方法后就会出现前面说的情况。

是c#调用dll里的方法有什么前提需求吗?

Problem type API / component name terminal type wechat version basic library version bug enterprise wechat session archiving SDK tool no no no I use C ා to develop session archiving function, call the official C DLL, use decrypt method decryptdata to return MSG, and then call getcontentfromslice (MSG) to generate some Chinese garbled code. Even Chinese characters will not be garbled, for example: "hello". The last word in the singular number of Chinese characters is a garbled code, for example: "please provide the next section?". Moreover, the last double quotation mark of the garbled data is not returned, which results in the failure to convert to JSON format. As shown in the following figure: a java version was developed before, and normal Chinese data can be returned if everything is normal. For the same session data, use the encrypt run in Java_ key、encrypt_ Encrypt from MSG and C ා_ key、encrypt_ MSG is consistent, but C ා calls the decryption method, and the above situation will appear. Is it C ා calling the method in DLL? Do you have any prerequisite requirements?

回答:

企业微信运营专员-千夜:

您好,麻烦提供下使用的是否是java 版本sdk,以及是win还是linux环境, jdk版本

Lurv ⁺¹:c和java的sdk都调用尝试了,结果一样。

win环境

c#编码。不是java

way1 on load (^_^):

感觉肯定是C#中的编码问题了,我用java版本也是正常的

Lurv ⁺¹:java的sdk和c的DecryptData方法参数不一样,我用c#调java的DecryptData方法时出现了你提问中的10008,请问这个错误码是因为啥?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值