Skip to content

Instantly share code, notes, and snippets.

@Climber24
Last active January 24, 2017 16:01
Show Gist options
  • Save Climber24/8c540a5418f624f809c4ac8ce439bf40 to your computer and use it in GitHub Desktop.
Save Climber24/8c540a5418f624f809c4ac8ce439bf40 to your computer and use it in GitHub Desktop.
JAVA Reading cyrillic file with BufferedReader and FileInputStream
public class FileCyrillic
{
public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String fileName = reader.readLine();
final BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream(fileName),
"UTF8"));
String nextString;
while ((nextString = br.readLine()) != null) {
System.out.println(nextString);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment