That's a Windows bug for which I could not find a reference anywhere else.
Service functions, e.g CreateService/OpenService, do not handle activeCodePage=UTF8 correctly
i.e if either service name, or the command line contain non-ASCIIs, it would produce a mojibake.
It affects us since we actually want to use activeCodePage=UTF8 , and need to ensure that as much as possible would work here, too
To reproduce, one will need reasonably new Windows (10 1903+).
1. Unpack the repro zip in the attachment
2. build the test executable
3. Call path\to\service_test.exe <string_with_non-ASCII_character>. It should create service with that name, but it does not happen, as we see later-
4. call "sc query <string_from_>" to see that service was not created, see below for demonstration
The fix/workaround we can do , is not to use those functions directly, but write a wrapper that actually does what is expected (convert string parameters from ANSI to wide, call wide function)