I'm fairly new to java. I'm making a text-based game right now. I have a few conversations in Korean saved in text files. and I'm loading it in a method with BufferReader with a following code:
Path read = Paths.get("conversation.txt");
try {
BufferedReader reader = Files.newBufferedReader(read, Charset.forName("euc-kr"));
String lineS = reader.readLine();
while (lineS != null) {
System.out.println(lineS);
}
lineS = reader.readLine();
sc.nextLine();
}
} catch (IOException e) {
System.out.println("Cannot find the file");
e.printStackTrace();
}
This doesn't have any problem if I run it in Eclipse. But if I run it in CMD, it makes error.
I almost finished making this game, and I'm going to send it to my friends. But it is making errors here. How could I resolve this problem?