I am using Java's Runtime.getRuntime().exec(String command) to open windows file explorer for a specified file. For that i am using the command :
explorer pathToOpen
This works for almost all the time unless the path contains some unicode characters that too in NFD(Normalization Form Canonical Decomposition) normalized form.
Let me take an example here. I am having the following command :
explorer C:\Test\földer
I have all 'C drive', 'Test' and 'földer' folders in my local file system. 'földer' conatins unicode character 'ö' in NFD form. Also I make sure that String which I am passing to exec method also contain same unicode character as in these folders i.e. in NFD form.
But this opens 'Documents' folder inside my user folder instead of opening 'földer'. If I create another folder lets say 'földerInNFC' where 'ö' is in NFC form, then if i do "explorer C:\Test\földerInNFC", then it opens the desired folder which is 'földerInNFC'.
I could see the same result from windows command prompt as well. I copied and pasted both the paths one by one and could see the same behavior. Here is a snippet of my command prompt. Also I could see that command prompt is not able to recognize 'ö' in NFD form but it is able to recognize 'ö' in NFC form.
Does both Runtime.getRuntime().exec() and cmd not support NFD unicode characters? If no, then is there another way in java to open windows file explorer for a specific file or folder which contains unicode characters in NFD form?