Skip to content

DLL Unicode path issues #3

@Titanic4

Description

@Titanic4

So far, the module works fine if the path doesn't contain any Unicode/UTF8 characters like emojis, country specific characters, etc.
If the path does contain such path, due to way the DLL path is acquired from the second parameter of injectPID function, it will attempt to convert the path to the local encoding instead. This leads to the non-existing path to be used instead.
I've just noticed this, since the new TruckersMP launcher actually uses this library for DLL injection. The most recent update(as for 20th December 2022) gives a warning in case if there's non-English character detected in the installation path.

For your information: TruckersMP is the multiplayer modification, which adds multiplayer functionality to both Euro Truck Simulator 2 and American Truck Simulator.

Examples:

  1. The requested DLL is located in D:\DLLs\ExampleDLL.dll - result: DLL gets injected without issues.
  2. The requested DLL is located in D:\😂\DLLs\ExampleDLL.dll - result: DLL doesn't get loaded, since the first subdirectory of the root of the D:\ drive has the emoji in its name. During name's conversion the emoji changes into mojibake, causing the path to unexpectedly change before the requested DLL gets injected.

I'm sure that other functions, which are using DLL paths as parameters are affected by the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions