Skip to content

Problem running in user account when username contains utf characters #238

Open
@TorstenKarusseit

Description

@TorstenKarusseit

Here is a simple test program (for jna 3.5.2):

import com.sun.jna.platform.win32.Kernel32Util;
public class Test
{
    public static void main(String[] args)
    {
        String s = Kernel32Util.getComputerName();
        return;
    }
}

When I test it on win7 account цц (2 cyrillic characters), I get the following exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\??\AppData\Local\Temp\jna1644595665224573683.dll: Can't find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
    at java.lang.Runtime.load0(Runtime.java:792)
    at java.lang.System.load(System.java:1059)
    at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:752)
    at com.sun.jna.Native.loadNativeLibrary(Native.java:737)
    at com.sun.jna.Native.<clinit>(Native.java:129)
    at com.sun.jna.Pointer.<clinit>(Pointer.java:42)
    at com.sun.jna.platform.win32.WinBase.<clinit>(WinBase.java:35)
    at com.sun.jna.platform.win32.Kernel32Util.getComputerName(Kernel32Util.java:41)
    at Test.main(Test.java:7)

When I test it on win7 account xx (2 'normal' characters), all goes fine.
This is heavy if you want to ship to russia or the most places in the world.
What may I do with this ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions