Good day. There was a problem when loading text from a file, Cyrillic is not displayed. Tell me how to fix it.
public String read(File file) { StringBuilder sb = new StringBuilder(); if (!file.exists()) { throw new RuntimeException("File not found!"); } try (BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream(file), Charset.forName("ISO-8859-1")))) { String s; while ((s = in.readLine()) != null) { sb.append(s); sb.append("\n"); } } catch (IOException e) { System.err.println("Error: " + e.getMessage()); } return sb.toString(); }