I use Java for file reading. Here's my code:
public static String[] fajlbeolvasa(String s) throws IOException
{
ArrayList<String> list = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(s), "UTF8"));
while(true)
{
String line = reader.readLine();
if (line == null)
{
break;
}
list.add(line);
}
}
However, when I read the file, then the output will be incorrect shaped.
For example: "Farkasgyep\305\261"
. Maybe something wrong with the BOM.
How can I solve this problem in Java? Will be grateful for any help.