.net

.net

博客园 首页 新随笔 联系 订阅 管理

web端和app端base64解码时中文乱码的问题.

 

web端:

String data = new BASE64Encoder().encode(data.getBytes("UTF-8"));

 

app端

String data2 = new String(Base64.decode(data), "UTF-8");

 

编码与解码时必须指定编码类型。

posted on 2015-04-02 21:01  航宇  阅读(1699)  评论(0编辑  收藏  举报