Skip to content

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

Merged
Hual merged 1 commit into
masterfrom
amir/fix-locale-switch
Jul 28, 2024
Merged

Hual merged 1 commit into
masterfrom
amir/fix-locale-switch

Conversation

@AmyrAhmady

Copy link
Copy Markdown
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
@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