Skip to content

Commit 017c69a

Browse files
committed
frontend: Add utf-8 active code page manifest
Declaring Utf-8 as active code page in manifest makes Win32 API use utf-8 instead of ANSI codepages when using the "A" versions of functions. Manifest declaration also encodes command line arguments as utf8. This allows for example --profile <name> to load profiles with special characters.
1 parent fad011f commit 017c69a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

frontend/cmake/windows/obs.manifest

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
</requestedPrivileges>
1212
</security>
1313
</trustInfo>
14+
<application>
15+
<windowsSettings>
16+
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
17+
</windowsSettings>
18+
</application>
1419
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
1520
<application>
1621
<!-- Windows 10 and Windows 11 -->

libobs/obs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,11 @@ EXPORT const char *obs_get_version_string(void);
382382
* and safely copies argv/argc from main(). Subsequent calls do nothing.
383383
*
384384
* @param argc The count of command line arguments, from main()
385-
* @param argv An array of command line arguments, copied from main() and ends
385+
* @param argv An array of command line arguments in UTF-8, copied from main() and ends
386386
* with NULL.
387+
*
388+
* On Windows this requires that active code page is UTF-8.
389+
* For example as a declaration in obs.manifest.
387390
*/
388391
EXPORT void obs_set_cmdline_args(int argc, const char *const *argv);
389392

0 commit comments

Comments
 (0)