Encoding Problem
C#
1
Posts
1
Posters
0
Views
1
Watching
-
HI, I have the following scenario. I am getting data from a web service which is encrypted. I decrypt the data and get a buffer of bytes. Now i need to convert that to a string. When i use Encoding.UTF8.GetString(byte[]), the returned string is complete but there is a space between every two consecutive characters. But when i use Encoding.Unicode.GetString(byte[]) then the string is fine(without spaces), but it eats away the last character of the string. Here is the code byte[] cipherTextBytes=Convert.FromBase64String(cipherText); /* My decryption code goes here */ return Encoding.UTF8.GetString(removeLength (outputBuffer)); Any solution please.... Wasif Ehsan