Fix locale switch for names with non-ascii characters #945
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We previously had issues with people running omp-server executable and it was getting closed right after "Loaded X components from XXX"
Which was a log message sent using
printLnU8
. Apparently for locales containing non-ascii characters, after changing locale to utf8,std::setlocale
fails to work properly, probably due to encoding being different? and requiring a utf8 version when trying to reset it? but using a wide char version of the function, it works fine (since wide chars can be used to store non-ascii values)References on discord:
user
ꜱɪᴄᴀʀɪᴏ
reporting it's not working for him, and apparently not for two other users as wellhttps://discord.com/channels/231799104731217931/966398440051445790/1231157837363806349
His video of showing how it looks:
https://github.com/user-attachments/assets/025b3de3-7175-401e-bc3d-056cf87748a8
We changed
printLnU8
toprintLn
and then it was working fine:https://github.com/openmultiplayer/open.mp/actions/runs/8764920431