For example the file that I needed is found at this filepath and it will be passed as an argument:
"C:\Users\user.name\docs\jap\あああいいいうううえええおおおダウンロード\filename.txt"
I used this code to decode the characters:
String new_path = new String(args[0].getBytes("Shift_JIS"), StandardCharsets.UTF_8);
System.out.println(new_path);
However, the output is:
C:\Users\user.name\docs\jap\あああい�?�?�?�?�?えええおおお�?ウンロード\filename.txt
Some of the characters have not been decoded properly. I already changed the text encoding and encoding of the console to UTF-8 but it still didn't work.
But if I would just print it regularly, it displays just fine.
System.out.println("C:\\Users\\user.name\\docs\\jap\\あああいいいうううえええおおおダウンロード\\filename.txt");
which displays:
C:\Users\user.name\docs\jap\あああいいいうううえええおおおダウンロード\filename.txt
Please tell me how to read the other characters, it really be a great help. Thanks!