Skip to content

Commit

Permalink
Fix for issue tsoding#29: Change the Codepage of the process to UTF-8
Browse files Browse the repository at this point in the history
To support loading filenames with unicode characters on windows, declare UTF-8
support in the manifest file.
  • Loading branch information
OetkenPurveyorOfCode committed Oct 22, 2023
1 parent dd590b8 commit b4e6128
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions nob.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ bool build_musializer(Config config)
nob_log(NOB_ERROR, "TODO: hotreloading is not supported on %s yet", NOB_ARRAY_GET(target_names, config.target));
nob_return_defer(false);
} else {
cmd.count = 0;
nob_cmd_append(&cmd, "rc");
nob_cmd_append(&cmd, "/fo", "./build/musializer.res");
nob_cmd_append(&cmd, "./src/musializer.rc");
// NOTE: Do not change the order of commandline arguments to rc. Their argparser is weird.
if (!nob_cmd_run_sync(cmd)) nob_return_defer(false);
cmd.count = 0;
nob_cmd_append(&cmd, "cl.exe");
if (config.microphone) nob_cmd_append(&cmd, "/DFEATURE_MICROPHONE");
Expand All @@ -336,13 +342,12 @@ bool build_musializer(Config config)
"./src/plug.c",
"./src/ffmpeg_windows.c"
// TODO: building resource file is not implemented for TARGET_WIN64_MSVC
//"./build/musializer.res"
);
nob_cmd_append(&cmd,
"/link",
nob_temp_sprintf("/LIBPATH:build/raylib/%s", NOB_ARRAY_GET(target_names, config.target)),
"raylib.lib");
nob_cmd_append(&cmd, "Winmm.lib", "gdi32.lib", "User32.lib", "Shell32.lib");
nob_cmd_append(&cmd, "Winmm.lib", "gdi32.lib", "User32.lib", "Shell32.lib", "./build/musializer.res");
// TODO: is some sort of `-static` flag needed for MSVC to get a statically linked executable
//nob_cmd_append(&cmd, "-static");
if (!nob_cmd_run_sync(cmd)) nob_return_defer(false);
Expand Down
4 changes: 3 additions & 1 deletion src/musializer.rc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
id ICON "./resources/logo/logo-256.ico"
#include <winuser.h>
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "utf8.xml"
id ICON "./resources/logo/logo-256.ico"

0 comments on commit b4e6128

Please sign in to comment.