Java scanner not going through entire file

后端 未结 8 1082
悲&欢浪女
悲&欢浪女 2020-11-30 11:31

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

8条回答
  •  执笔经年
    2020-11-30 12:05

    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");   
    

提交回复
热议问题