下面這三段代碼在效果上有什么區(qū)別?使用2次utf-8//decodewithbase64togetbytesbyte[]dec=BASE64DecoderStream.decode(str.getBytes("UTF-8"));使用1次utf-8byte[]utf8=dcipher.doFinal(dec);//createnewstringbasedonthespecifiedcharsetreturnnewString(utf8,"UTF8");使用1次utf-8//decodewithbase64togetbytesbyte[]dec=BASE64DecoderStream.decode(str.getBytes());byte[]utf8=dcipher.doFinal(dec);//createnewstringbasedonthespecifiedcharsetreturnnewString(utf8,"UTF8");使用1次utf-8使用1次utf-8//decodewithbase64togetbytesbyte[]dec=BASE64DecoderStream.decode(str.getBytes("UTF-8"));使用1次utf-8byte[]utf8=dcipher.doFinal(dec);//createnewstringbasedonthespecifiedcharsetreturnnewString(utf8);
字符集編碼問題
暮色呼如
2019-04-19 16:29:43