Description
FULL PRODUCT VERSION :
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Calling System.load() on a path which contains one or more unicode characters will fail.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Copy any DLL to a path containing unicode characters. This was first exhibited attempting to load from java.io.tmpdir on a user with a non-ascii username.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
DLL should load without errors.
ACTUAL -
UnsatisfiedLinkError is thrown, with varying error messages depending on windows version.
This is likely due to System.load() using the ascii version of the LoadLibrary or LoadLibraryEx function in the w32 API.
Note that IBM's J9 JVM does not exhibit this problem.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.UnsatisfiedLinkError: C:\tmp\testLoadFromUnicodePath-?????\mylib.dll: Can't find dependent libraries
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
File dll = new File( " C:\tmp\testLoadFromUnicodePath-?????/mylib.dll " );
System.load(dll.getAbsolutePath());
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Load file from non-unicode path.
This is problematic when attempting to load from a user-specific path and the user's name includes unicode characters.
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Calling System.load() on a path which contains one or more unicode characters will fail.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Copy any DLL to a path containing unicode characters. This was first exhibited attempting to load from java.io.tmpdir on a user with a non-ascii username.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
DLL should load without errors.
ACTUAL -
UnsatisfiedLinkError is thrown, with varying error messages depending on windows version.
This is likely due to System.load() using the ascii version of the LoadLibrary or LoadLibraryEx function in the w32 API.
Note that IBM's J9 JVM does not exhibit this problem.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.UnsatisfiedLinkError: C:\tmp\testLoadFromUnicodePath-?????\mylib.dll: Can't find dependent libraries
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
File dll = new File( " C:\tmp\testLoadFromUnicodePath-?????/mylib.dll " );
System.load(dll.getAbsolutePath());
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Load file from non-unicode path.
This is problematic when attempting to load from a user-specific path and the user's name includes unicode characters.
Attachments
Issue Links
- relates to
-
JDK-8195129 System.load() fails to load from unicode paths
- Open