commit b805f93590c542532652a39f6806fdbf473c1d5c
parent c54b3b2ad3ec2a1b3bb22a9efa9c3f9040e47b50
Author: Jordan Ritter <jpr5@darkridge.com>
Date: Mon, 3 Dec 2007 11:30:33 +0000
an attempt at solving some weird utf-8 issue (but not fixed yet)
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ngrep.c b/ngrep.c
@@ -197,7 +197,13 @@ int main(int argc, char **argv) {
#endif
#if !defined(_WIN32)
- setlocale(LC_ALL, "");
+ {
+ char const *locale = getenv("LANG");
+ if (locale == NULL)
+ locale = "en_US";
+
+ setlocale(LC_CTYPE, locale);
+ }
#endif
while ((c = getopt(argc, argv, "LNhXViwqpevxlDtTRMCs:n:c:d:A:I:O:S:P:F:W:")) != EOF) {