Java服务器上的Base64解码问题
我在客户端工作,在编码/解码数据方面遇到问题。服务器接收到的解码后的字符串与客户端发送的字符串不同。我不知道可能是什么问题。以前有人遇到过这个问题吗?服务器有问题还是我做错了什么?
我在自己的一端检查了某些字符串“abc”的结果,并且得到了正确的结果。但是当服务器进行解码时,它显示出不同的结果。
对于 Base64,我使用 这个。
I am working on the client side and I am facing problems in encoding/decoding data. The decoded string received at server is different from the string sent by the client. I can't figure out what might be the problem. Has anyone encountered this problem before? Is there something wrong at server or have I done something wrong?
I checked the result for for some string "abc" at my own end and I am getting the correct result. But when server does the decoding, it shows different result.
For Base64 I used this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Nitish 我认为现在您所做的错误在于将其发送到服务器,如果两种方法都在客户端和服务器端使用,那么发送到服务器的http消息将出现错误交叉检查我认为您会得到结果。
Nitish i think now the fault you doing is in the sending it to server if both approach are using on client and server end then it will be a fault in the http message sending to server cross check that thing i think you will get the result.
您如何在服务器端解码。您使用哪些 API?
您可能需要查看Commons Codec。你也可以看看这个讨论在java中进行base64编码/解码
How are you decoding on server side. which APIs are you using ?
You may want to look to Commons Codec. Also you can look at this discussion for base64 encode/decode in java