Last active
August 29, 2015 14:01
-
-
Save gnosis23/2e0c17a9748c23889a8a to your computer and use it in GitHub Desktop.
encoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
InputStream fis = app.class.getClassLoader().getResourceAsStream("input.txt"); | |
InputStreamReader isr = new InputStreamReader(fis, "GBK"); | |
Reader in = new BufferedReader(isr); | |
FileOutputStream fos = new FileOutputStream("D:/download/test.txt"); | |
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8"); | |
Writer out = new BufferedWriter(osw); | |
int ch; | |
while ((ch = in.read()) > -1) { | |
out.write(ch); | |
} | |
out.close(); | |
in.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment