java scanner chinese character
I just find it is difficult to scan Chinese character in Java.
For reading UTF-8
chinese character by Scanner
, you need to identify the char-set.
Scanner sc = new Scanner(file, "utf-8");
Or sc,hasNext()
will end inaccidently.