Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected character encountered while parsing value: �. Path '', line 0, position 0. #2057

Closed
6 tasks
1378955720 opened this issue Dec 9, 2019 · 7 comments
Closed
6 tasks

Comments

@1378955720
Copy link

1378955720 commented Dec 9, 2019

问题描述

在微信成功授权,解密手机号的时候偶尔:Unexpected character encountered while parsing value: �. Path '', line 0, position 0.此问题不是每次都会出现,本人在用源码调试的时候,会发现是因为解密后得到的字符串是乱码的。我试着换了几个Encoding还是不行,返回乱码的是在EncryptHelper.DecodeEncryptedData这个方法中。

微信官方文档 URL
微信官方文档快照(直接复制关键内容到下方)
发现问题的模块
  • Senparc.Weixin.WxOpen 版本:3.7.104
  • Senparc.Weixin.Cache.Redis 版本:2.7.104
模块对应的 .net 版本
  • .net core 2.0
开发环境
  • Visual Studio 2017
缓存环境
  • Redis 版本:Caching.CSRedis 3.0.51
系统环境
  • Linux,版本:
@JeffreySu
Copy link
Owner

能把你出现乱码时候的所有相关数据发过来看一下吗?包括原始密文,以及解密需要的所有参数。如果涉及到密钥,可以发送到 zsu@senparc.com

@JeffreySu
Copy link
Owner

是 **wolf@qq.com 这个邮箱发来的吗?

@JeffreySu
Copy link
Owner

@1378955720 可以参考这里:#1869 (comment)

@1378955720
Copy link
Author

是 **wolf@qq.com 这个邮箱发来的吗?

不好意思,现在才看到,我还没发过邮箱给你,我稍后可以发给你。

@JeffreySu
Copy link
Owner

@1378955720 后来有发过来吗?

@yueliuhun
Copy link

这个问题前端做POST前,参数做urlencode处理就行了!

@fairok
Copy link

fairok commented Jul 1, 2021

这个我在解密profile的时候会有一定概率出现这个问题,前端参数post前也做了encodeURI的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants