字段的转码

1 if (note.equals(new String(note.getBytes("GB2312"), "GB2312"))) {
2                 note = new String(note.getBytes("GB2312"), "utf-8");
3             } else if (note.equals(new String(note.getBytes("iso-8859-1"), "iso-8859-1"))) {
4                 note = new String(note.getBytes("iso-8859-1"), "utf-8");
5             } else if (note.equals(new String(note.getBytes("UTF-8"), "UTF-8"))) {
6                 note = new String(note.getBytes("UTF-8"), "utf-8");
7             } else if (note.equals(new String(note.getBytes("GBK"), "GBK"))) {
8                 note = new String(note.getBytes("GBK"), "utf-8");
9             }

 

posted @ 2016-07-14 11:41  晓疯  阅读(201)  评论(0编辑  收藏  举报