We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在windows的cmd中运行,默认是GBK2312,这样加密出来会有问题 微信返回结果如下 <xml> <return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[参数错误,请检查参数]]></return_msg> <result_code><![CDATA[FAIL]]></result_code> <err_code><![CDATA[PARAM_ERROR]]></err_code> <err_code_des><![CDATA[用户真实姓名存在非UTF8字符]]></err_code_des> <nonce_str><![CDATA[1539222582130]]></nonce_str> <mch_id><![CDATA[1515170561]]></mch_id> <partner_trade_no><![CDATA[1539222572663]]></partner_trade_no> <amount>10</amount> </xml> 追查原因 com.github.binarywang.wxpay.service.impl.EntPayServiceImpl.encryptRSA(File, String) 代码中 byte[] encrypt = cipher.doFinal(srcString.getBytes()); 改成 byte[] encrypt = cipher.doFinal(srcString.getBytes("UTF-8")); 是不是更合理些? @binarywang
<xml> <return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[参数错误,请检查参数]]></return_msg> <result_code><![CDATA[FAIL]]></result_code> <err_code><![CDATA[PARAM_ERROR]]></err_code> <err_code_des><![CDATA[用户真实姓名存在非UTF8字符]]></err_code_des> <nonce_str><![CDATA[1539222582130]]></nonce_str> <mch_id><![CDATA[1515170561]]></mch_id> <partner_trade_no><![CDATA[1539222572663]]></partner_trade_no> <amount>10</amount> </xml>
com.github.binarywang.wxpay.service.impl.EntPayServiceImpl.encryptRSA(File, String)
byte[] encrypt = cipher.doFinal(srcString.getBytes());
byte[] encrypt = cipher.doFinal(srcString.getBytes("UTF-8"));
The text was updated successfully, but these errors were encountered:
可以
Sorry, something went wrong.
#788 批量修改所有使用字符串的getBytes方法的地方,显式使用utf-8编码,以免某些场景下出问题
34cea66
3.2.1.B测试版本已包含相关代码
No branches or pull requests
在windows的cmd中运行,默认是GBK2312,这样加密出来会有问题
微信返回结果如下
<xml> <return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[参数错误,请检查参数]]></return_msg> <result_code><![CDATA[FAIL]]></result_code> <err_code><![CDATA[PARAM_ERROR]]></err_code> <err_code_des><![CDATA[用户真实姓名存在非UTF8字符]]></err_code_des> <nonce_str><![CDATA[1539222582130]]></nonce_str> <mch_id><![CDATA[1515170561]]></mch_id> <partner_trade_no><![CDATA[1539222572663]]></partner_trade_no> <amount>10</amount> </xml>
追查原因
com.github.binarywang.wxpay.service.impl.EntPayServiceImpl.encryptRSA(File, String)
代码中
byte[] encrypt = cipher.doFinal(srcString.getBytes());
改成
byte[] encrypt = cipher.doFinal(srcString.getBytes("UTF-8"));
是不是更合理些?
@binarywang
The text was updated successfully, but these errors were encountered: