[glib: 7/15] tests: Add setlocale() call to spawn-singlethread




commit 52dc7cb9dd8512309b04cc16f9f1fc16aaef0b5e
Author: Philip Withnall <pwithnall endlessos org>
Date:   Fri Dec 4 18:21:10 2020 +0000

    tests: Add setlocale() call to spawn-singlethread
    
    This allows non-ASCII characters to be used in test messages from it.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 glib/tests/spawn-singlethread.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/glib/tests/spawn-singlethread.c b/glib/tests/spawn-singlethread.c
index c4417fe19..cfc8fd491 100644
--- a/glib/tests/spawn-singlethread.c
+++ b/glib/tests/spawn-singlethread.c
@@ -24,6 +24,7 @@
 #include "config.h"
 
 #include <glib.h>
+#include <locale.h>
 #include <string.h>
 #include <fcntl.h>
 
@@ -427,6 +428,8 @@ main (int   argc,
   char *dirname;
   int ret;
 
+  setlocale (LC_ALL, "");
+
   g_test_init (&argc, &argv, NULL);
 
   dirname = g_path_get_dirname (argv[0]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]