Possible duplicate: How can I read Chinese characters correctly using Scanner in Java?
My input file name may have japanese characters and I am trying to read the fi
Your code is correct, only issue is you are reading utf-8
and then converting it to Shift_JIS
which prints junk characters.
Have you tried using this.
Scanner sc = new Scanner(System.in,"utf-8");
System.out.println("Encoding is :" + Charset.defaultCharset());
System.out.println("Enter the path:");
String inputFilePath = sc.nextLine();
System.out.println("Input path:" + new String(inputFilePath.getBytes("utf-8")));
Hope this helps !!