XML base64 解密后 >变成?
例:解析后 <?xml version="1.0" encoding="gb2312"?? <root?<bb><cc>11</cc></bb></root>
我试了utf-8,gb2312,gbk 这种情况还是不能解决
[解决办法]
一个简单的例子
public static void main(String[] args) throws IOException {
String res = "<?xml version="1.0" encoding="gb2312"?><root><bb><cc>11</cc></bb></root>";
BASE64Encoder encoder = new BASE64Encoder();
String target = encoder.encode(res.getBytes());
BASE64Decoder decoder = new BASE64Decoder();
byte[] buf = decoder.decodeBuffer(target);
String str = new String(buf);
System.out.println(str);
}