【问题标题】:Base 64 Decoding in android issuesandroid问题中的Base 64解码
【发布时间】:2016-05-27 09:52:57
【问题描述】:

我已使用此编码过程 var 从服务器接收到解码 String

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

在我们使用的我的安卓应用上

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

但是当我们将此设置设置为文本视图时,它不会显示格式化。

谢谢……

【问题讨论】:

  • @Ironman 请检查问题代码

标签: android encoding base64 decoding utf8-decode


【解决方案1】:

在设置文本之前使用它。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-17
    • 2018-05-27
    • 1970-01-01
    相关资源
    最近更新 更多