我试图显示和使用Base64更新简化。中国(GB2312)字符集,Base64编码为GB2312工作正常,但我不能够转换GB2312为Base64字符集编码问题 - Base64编码为GB2312为Base64
String str="17DP5Mqxx+vFxNXV";
Base64 base64=new Base64();
String gb2312=new String(base64.decode(str.getBytes()),"GB2312");
System.out.println("GB2312 = "+gb2312);
String baseString=new String(base64.encode(gb2312.getBytes()));
System.out.println("Base64 = "+baseString);
Aactual结果是
GB2312 =装箱时请拍照
的Base64 = 6KOF566x5pe26K + 35ouN54Wn
预期结果为:
GB2312 =装箱时请拍照
的Base64 = 17DP5Mqxx + vFxNXV
我很难说,但在这两种情况下GB2312是否正确? – Woot4Moo