Android API的Base64解码问题
我正在尝试解码从plist(属性列表)文件的“data”标记中提取的字符串。从苹果官方开发者网站上,我了解到了这一点 “数据字节在和标记之间以base-64编码。” 问题:Android API的Base64解码问题,android,base64,plist,Android,Base64,Plist,我正在尝试解码从plist(属性列表)文件的“data”标记中提取的字符串。从苹果官方开发者网站上,我了解到了这一点 “数据字节在和标记之间以base-64编码。” 问题: String result = new String((Base64.decode(extracted_string.getBytes(“UTF-8"), Base64.DEFAULT)), “UTF-8”)); 样本输入: String result = new String((Base64.decode(extract
String result = new String((Base64.decode(extracted_string.getBytes(“UTF-8"), Base64.DEFAULT)), “UTF-8”));
样本输入:
String result = new String((Base64.decode(extracted_string.getBytes(“UTF-8"), Base64.DEFAULT)), “UTF-8”));
2.2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2NEAWN0AW9UYXJ5WE5TT2JQZWN0X5TRGLJDGLVbFYDYKTOYORLF8QGU5TTXV0YWJJJJJJJJPbJW0W0W0W0W0W0W0JJJJJJJYNV0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0瓦阿阿阿阿阿阿阿阿阿阿阿巴姆格==
在线生成的输出
bplist00./T$topX$objectsX$versionY$archiverroot(零美元) \NSAttributesXNSStringV$类 YNS.stringRHiX$classesZ$classname\u可变字符串xnsstringxnsobject\u可变字符串 !“ZNS.objectsWNS.keys$'%&\NSDictionaryXNSObject\NSDictionary)-*+,\u NSMutableAttributedString\u NSAttributedStringXNSObject\u NSMutableAttributedString\u NSKeyedArchiver(25: 由我的代码生成的输出:
String result = new String((Base64.decode(extracted_string.getBytes(“UTF-8"), Base64.DEFAULT)), “UTF-8”));
bplist00./T$topX$objectsX$versionY$archiverroot
这是我解码提取字符串的代码:
String result = new String((Base64.decode(extracted_string.getBytes(“UTF-8"), Base64.DEFAULT)), “UTF-8”));
我尝试过使用不同的Base64.decode函数标志,但没有一个能产生与web工具相同的输出
我有以下问题:
String result = new String((Base64.decode(extracted_string.getBytes(“UTF-8"), Base64.DEFAULT)), “UTF-8”));
替换为:
String result = new String(Base64.decode(extracted_string, Base64.DEFAULT));
我发布的代码正确地解码了base64编码字符串。Android Studio控制台没有显示整个解码字符串(可能是由于显示某些字符的限制).尝试检查变量result的值。我认为它有'\n',因此console仅显示第一行。感谢您的回复,但我在console上找到了具有变量result的相同输出。感谢您的回复。上面的代码段生成了相同的结果。