0

I have used Base 64 files from the below link to decode my response that I receive from server: nicklockwood / Base64

But somehow it fails when it encouters special characters. How can I solve this issue. It works when I tried it with Hex both server side and clienct side.

Dee
  • 1,887
  • 19
  • 47
  • Can you show us how you get your data ? Is it a valid string ? If it's possible, could you show us a base64 string that fails decoding ? – DCMaxxx Jun 17 '13 at 06:42
  • "Special Characters" implies that the server is sending you encodes Unicode chars? – CodaFi Jun 17 '13 at 06:42
  • Yes. I receive _ - in my reponse. Based on this link:http://stackoverflow.com/questions/13926513/decode-java-encoded-base64-string-in-c-sharp#comment19199254_13926513 ... I am replacing the values with + /. Hope it works. – Dee Jun 17 '13 at 07:21
  • So, did it work ? If so, answer to yourself, it might help other users. – DCMaxxx Jun 17 '13 at 12:38

1 Answers1

0

I have folled the below link:

Decode Java encoded Base64 string in C#

and replaced - and _ that Java uses with the + and / that C# uses. It worked.

Community
  • 1
  • 1
Dee
  • 1,887
  • 19
  • 47