どのように特定の出力エンコードされた文字列

公共の文字列{(文字列str)を変換

 文字列tempStr =「」;
 {しようと
 tempStr =新しい文字列(str.getBytes(「ISO-8859-1 ")、『GBK』); //输出ISO-8859-1的字符串
 tempStr = tempStr.trim();
 }
 キャッチ(例外e){
 System.err.println(e.getMessage())。
 }
 戻りtempStr。
 }

おすすめ

転載: www.cnblogs.com/hurong07/p/11208115.html