obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

Fix mixed WCS and UTF-8 format strings

Open notr1ch opened this issue 3 years ago • 0 comments

Description

PRs #7749 and #7766 highlighted a bug in how we process wide character format strings. For whatever reason, these are locale-dependent and without us changing the process locale, the strings would either be truncated or empty when the *sprintf family of functions hit the wide character bytes. Unfortunately these PRs were closed without resolution, so I am trying to finish the changes required.

Motivation and Context

Missing information in log files is bad, and possibly empty monitor names is worse.

How Has This Been Tested?

Breakpoint tested most changes, winrt errors were not easy to trigger but the code looks correct.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

notr1ch avatar Jan 02 '23 00:01 notr1ch