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:
- https://github.com/FenPhoenix/AngelLoader/blob/master/AngelLoader_Stub/dllmain.cpp#L139
- 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:
- add two local accounts, one with ASCII username, one with Unicode username.
- Find Angel Loader exe, hold shift, right click, select 'run as another user', and try with the new ASCII user, it should work.
- 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:
- 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 *.
- 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.
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:Attempting to convert a path to
std::stringwhen there are non-ASCII characters causes an exception, terminating the game (but see note at the end).You can test this yourself:
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:
args_file.c_str()to get awchar_tpointer and preserve the Unicode, thestd::ifstreamconstructor has an overload that handleswchar_t *.std::remove(which is old Cchar *only function) - https://en.cppreference.com/w/cpp/filesystem/removeAnother 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.