I\'m writing a program in Java and one of the things that I need to do is to create a set of every valid location for a shortest path problem. The locations are defined in a
I encountered the same problem and this is what I did to fix it:
1.Saved the file I was reading from into UTF-8
2.Created new Scanner like below, specifying the encoding type:
Scanner scanner = new Scanner(new File("C:/IDSBRIEF/GuidData/"+sFileName),"UTF-8");
You should use this :
Scanner scanner = new Scanner(fileObj).useDelimiter("\z");
System.out.println(scanner.next());