我用的是base64类可能和你的不一样,但用法应该是差不多的,示例如下:编码:
String strSource;
String strBase64 = base64.encode(strSource.getBytes("gb2312"));解码:
String str = new String(base64.decode(strBase64,"gb2312");
String strSource;
String strBase64 = base64.encode(strSource.getBytes("gb2312"));解码:
String str = new String(base64.decode(strBase64,"gb2312");
都可以编码和解码的。