Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix locale switch for names with non-ascii characters #945

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

AmyrAhmady
Copy link
Member

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 well
https://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 to printLn and then it was working fine:
https://github.com/openmultiplayer/open.mp/actions/runs/8764920431

@Hual Hual merged commit e47485e into master Jul 28, 2024
14 checks passed
@AmyrAhmady AmyrAhmady deleted the amir/fix-locale-switch branch July 28, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants