[hackers] [sbase][PATCH] grep: fix UTF-8 support

From: Mattias Andrée <maandree_AT_kth.se>
Date: Mon, 4 Apr 2016 12:39:30 +0200

Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
---
 grep.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/grep.c b/grep.c
index 64ffbe2..22b3b6f 100644
--- a/grep.c
+++ b/grep.c
_AT_@ -1,4 +1,5 @@
 /* See LICENSE file for copyright and license details. */
+#include <locale.h>
 #include <regex.h>
 #include <stdio.h>
 #include <stdlib.h>
_AT_@ -178,6 +179,8 @@ main(int argc, char *argv[])
 	FILE *fp;
 	char *arg;
 
+	setlocale(LC_ALL, "");
+
 	SLIST_INIT(&phead);
 
 	ARGBEGIN {
-- 
2.8.0
Received on Mon Apr 04 2016 - 12:39:30 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 04 2016 - 12:48:17 CEST