Im having problems whith base64 between java and c#, im sending encoded string to a asp.net handler from an java urlconnection, i compare both strings, the one generated in java from byte array and the one received in asp.net first decoding and both are identical but after decode the byte array in c# arent equal from byte array in java.
Im using new sun.misc.BASE64Encoder().encode(javabytearray); in java and System.Convert.FromBase64String(encodedstring); in dotnet.
from java: "[0] [-24] [56] [1] [-56] [41] [-29] ........."
to dotnet: "[0] [232] [56] [1] [200] [41] [227] ........."
Similar: Encoding base64 in Java and decoding in C#
i cant ask it in question above because it is an Q&A site and every time an new question must be created, cant ask an question inside another question.
thanks a lot
2
votes
Seems like bytes in -128..0 range are converted to 256+b in c#. Loss of sign somewhere.
– Victor Sorokin
Mate - thanks for this post.
– AntDC