Page 1 of 1

FileUtils.ReadFileToString () von Apache Commons IO funktioniert fälschlicherweise mit Cyrillic

Posted: 28 Feb 2025, 05:04
by Anonymous
Ich verwende FileUtils.ReadFileToString, um den Inhalt einer Textdatei mit JSON gleichzeitig zu lesen. Die Datei ist UTF-8 codiert (w/o BOM). Doch anstelle von kyrillischen Buchstaben bekomme ich ?????? Zeichen. Warum? < /P>

Code: Select all

public String getJSON() throws IOException
{
File customersFile = new File(this.STORAGE_FILE_PATH);
return FileUtils.readFileToString(customersFile, StandardCharsets.UTF_8);
}