Java Scanner Changing String
问题 I'm doing some basic file reading from a text file using Scanner. The first 5 entries are this - 0 MR2Spyder 1 Tundra 3 Echo 3 Yaris 4 ScionxB 4 ScionxD I instantiate the scanner normally and then do this - String line = scanner.nextLine(); System.out.println(line); I then get this output - ÿþ0 M R 2 S p y d e r Which doesn't make sense to me- is there some problem with the Scanner class? Should I be using BufferedReader? 回答1: Your file is encoded using UTF-16... the spaces between characters