Can you help me to get the correct file path? I give in the arguments a link to a file with the name:
GovHK 香港政府一站通:Homepage (Residents).webloc
And instead of it I receive:
GovHK ???????:Homepage (Residents).webloc
So I can not get file, file.exists();
returns false
public class Test {
public static void main(String[] args) {
if (args.length > 0) {
File file = new File(args[0]);
System.out.println("Exists: " + file.exists());
}
}
}
File was taken from MacOS to Windows.
You can see the original file here
How can I get the real file path to handle it? Thank you!
UPD
If I get list of files in the directory, file path is showing correctly and files exist. So the problem is on way cmd -> jar
Thanks to @MikitaBerazouski question, we found out that it is an issue of Windows console encoding.
[UPDATE]