Base 64 Decoding in android issues

93 Views Asked by At

I have received the decode String from a server by using this encoding process var

 data = System.Text.Encoding.UTF8.GetBytes (text); 
 text =  System.Convert.ToBase64String (data);

on my android app we using

byte [] data = Base64.decode(base64data,Base64.DEFAULT);
String text1 = new String (data, "UTF-8");

but when we set this setting to text view it does not show formatted.

Thank you....

1

There are 1 best solutions below

0
tech_android On

Use it before set text .

text1 = text1.replaceAll("[\n\r]", "WRAP");
text1 = text1.replaceAll("WRAP", "\n\r");