my Scanner doesn't read my existing File which is read by a BufferedReader but BufferedReaders don't support UTF-8 encoding which my file needs.
I've already used a BufferedReader(even with UTF-8 which didn't give me letters like "ä"(german letter) but gave me awkward question mark symbols instead). And I've of course already used a Scanner.
public ArrayList<String> getThemefile2() {
Scanner s;
try {
s = new Scanner(themefile);
} catch (FileNotFoundException e) {
e.printStackTrace();
return new ArrayList<>();
}
ArrayList<String> list = new ArrayList<>();
while (s.hasNextLine()) {
list.add(s.nextLine());
}
s.close();
return list;
}
It just returns an empty ArrayList, but doesn't trigger the FileNotFoundException. themefile is an existing File.