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

Fixed incorrect locale saving in Core::vlogLnInternal(). #656

Merged
merged 1 commit into from
May 16, 2023

Conversation

dev-karpov0
Copy link
Contributor

There was a bug in function Core::vlogLnInternal(...) related to incorrect saving of the locale when utf8=true. It led to incorrect text output to the console after calling this function.

Reason: std::setlocale(), if success, returns a pointer to a new locale, not an old.

To recreate a bug:

  1. print some string from script using non-latin symbols e.g. Cyrillic (cp1251)
  2. Do something that make Core::vlogLnInternal(.utf8=true) call. (e.g. Input invalid command into console)
  3. Print string again

@CLAassistant
Copy link

CLAassistant commented May 15, 2023

CLA assistant check
All committers have signed the CLA.

@ksenonadv ksenonadv merged commit 03868d4 into openmultiplayer:master May 16, 2023
10 checks passed
@dev-karpov0 dev-karpov0 deleted the fix-locale branch May 16, 2023 09:47
@Hual
Copy link
Collaborator

Hual commented May 16, 2023

This should fix #643 #637 #617 and #583

@Y-Less
Copy link
Collaborator

Y-Less commented May 18, 2023

Why was debug level filtering added as well via this?

@dev-karpov0
Copy link
Contributor Author

That condition was not added but moved higher (before the _lock_locales() call). Otherwise, if condition were true, _unlock_locales() would not be called.

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.

None yet

5 participants