From 90bad24f96deeaaa2255f0ad89ece21d5397b78b Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 29 Aug 2024 02:12:09 +0200 Subject: allow Unicode characters in command line arguments (refs #5) * the locale must be initialized very early before g_option_context_parse() * will allow UTF-8 characters in the test suite --- src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 5785ef5..c38b1a3 100644 --- a/src/main.c +++ b/src/main.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -306,6 +307,13 @@ main(int argc, char **argv) signal(SIGINT, teco_sigint_handler); signal(SIGTERM, teco_sigint_handler); + /* + * Important for Unicode handling in curses and glib. + * In particular, in order to accept Unicode characters + * in option strings. + */ + setlocale(LC_ALL, ""); + g_autofree gchar *mung_filename = teco_process_options(&argc, &argv); /* * All remaining arguments in argv are arguments -- cgit v1.2.3