commit 0845a1a6f76997c0577c9828110b8f8952e1e80d
parent bbaecb2fcb1b186214a33c54506af8d685dbe692
Author: Chris Bracken <chris@bracken.jp>
Date: Sat, 21 Feb 2026 00:13:27 +0900
Ass setlocale call to ensure mbrtowc and wcwidth behave well
Diffstat:
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/gout_index_main.c b/src/gout_index_main.c
@@ -1,5 +1,6 @@
#include "gout_index.h"
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
@@ -10,6 +11,7 @@ static void gout_index_usage(const char* program_name) {
}
int main(int argc, const char* argv[]) {
+ setlocale(LC_ALL, "");
GoutIndexOptions* options = gout_index_options_create(argc, argv);
if (options == NULL) {
gout_index_usage(argv[0]);
diff --git a/src/gout_main.c b/src/gout_main.c
@@ -1,5 +1,6 @@
#include "gout.h"
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
@@ -12,6 +13,7 @@ static void gout_usage(const char* program_name) {
}
int main(int argc, const char* argv[]) {
+ setlocale(LC_ALL, "");
GoutOptions* options = gout_options_create(argc, argv);
if (options == NULL) {
gout_usage(argv[0]);