1,将GBK转换为UTF-8
public class Text01 {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(new FileInputStream("G:\\xxx\\GBK.txt"),"GBK");
OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("G:\\xxx\\UTF-8.txt"),"UTF-8");
char[] chars = new char[1024 * 8];
int length;
while ((length = isr.read(chars)) != -1){
osw.write(chars,0,length);
}
osw.close();
isr.close();
}
}