Launcher hides specific symbols from bundled jar
benchdoos opened this issue · 1 comments
Hello!
Have found a bug when application is called with unicode symbols in arguments.
Actually they are not supported by java.
I need to start with a little background to let you understand the main trouble:
Just using java to get calling arguments will modify them and it can affect on application working:
For example: calling application with file argument in path:
C:\files\İnteraktif Vergi Dairesi.webarchive
your file path will be transformed to:
C:\files\Interaktif Vergi Dairesi.webarchive
as you may notice symbol İ
will be replaced to I
. So surprise: no file would be found on given location.
Any solutions?
One of the solutions is to use JNA to use Windows kernel libs to get real application arguments. One of examples described here: https://stackoverflow.com/questions/70546736/netbeans-chinese-characters-in-java-project-properties-run-arguments
So what's the point and why I created this issue?
If I use such kernel solution, I can get actual arguments from kernel and everything is fine - file path will be correct:
C:\files\İnteraktif Vergi Dairesi.webarchive
But if application jar will be bundled or wrapped by exe launcher - all arguments would be replaced by java default arguments processing, so actual arguments would be hidden by java:
C:\files\Interaktif Vergi Dairesi.webarchive
Is there any ideas how to avoid this behavior?