Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Does not work if my username contains non-ASCII characters (fix PR provided) #83

@FRex

Description

@FRex

Hello. The file that stub loads is in the %TMP% directory. That path usually contains the username. In case of non-ASCII usernames there are two lines that prevent the game from starting:

  1. https://github.com/FenPhoenix/AngelLoader/blob/master/AngelLoader_Stub/dllmain.cpp#L139
  2. https://github.com/FenPhoenix/AngelLoader/blob/master/AngelLoader_Stub/dllmain.cpp#L181

Attempting to convert a path to std::string when there are non-ASCII characters causes an exception, terminating the game (but see note at the end).

You can test this yourself:

  1. add two local accounts, one with ASCII username, one with Unicode username.
  2. Find Angel Loader exe, hold shift, right click, select 'run as another user', and try with the new ASCII user, it should work.
  3. If everything worked correctly, try the same with non-ASCII user, it should not work.

Let me know if you cannot reproduce this.

If you can reproduce it, then you can test the fix I have created here: #82

The fix is to:

  1. use args_file.c_str() to get a wchar_t pointer and preserve the Unicode, the std::ifstream constructor has an overload that handles wchar_t *.
  2. user proper C++17 filesystem library remove function instead of std::remove (which is old C char * only function) - https://en.cppreference.com/w/cpp/filesystem/remove

Another possible change would be to not use a temporary file but use an environment variable to pass the data from Angel Loader to stub, but it'd be more invasive than this fix.

I am experienced in C and C++ so if you would like any other changes done to the stub (cleaning up the code, slimming it down, or looking into your problem with fopen) then let me know.

NOTE: I am not sure if language set on the PC matters, e.g. if a French user on French Windows would not have this problem. My Windows is set to English (US) so there is a mismatch between Windows language and the diacritics used in the username.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedFixed the bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions