Skip to content

Instantly share code, notes, and snippets.

@steklopod
Last active July 9, 2018 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steklopod/8cb740ceb3077be2acb0412aba882547 to your computer and use it in GitHub Desktop.
Save steklopod/8cb740ceb3077be2acb0412aba882547 to your computer and use it in GitHub Desktop.
io
package com.javarush.task.task22.task2211;
import java.io.*;
import java.io.IOException;
/*
Смена кодировки
*/
public class Solution {
static String win1251TestString = "Нарушение кодировки консоли?"; //only for your testing
public static void main(String[] args) throws IOException {
FileInputStream inputStream=new FileInputStream(args[0]);
FileOutputStream outputStream=new FileOutputStream(args[1]);
byte[] buff=new byte[inputStream.available()];
inputStream.read(buff);
String s= new String(buff, "UTF-8");
outputStream.write(s.getBytes("Windows-1251"));
inputStream.close();
outputStream.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment