diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-05-15 11:30:18 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-05-15 11:30:18 +0000 |
commit | 73535010d72d1a7d46e4f5c6c98f41fab90df489 (patch) | |
tree | c704e4155e42372132a39c6f4fbc5d4cc31afda0 /winsup/utils/mkgroup.c | |
parent | a972ea99d54c5834eb0bd8d5e40e1045d2e21d3f (diff) | |
download | cygnal-73535010d72d1a7d46e4f5c6c98f41fab90df489.tar.gz cygnal-73535010d72d1a7d46e4f5c6c98f41fab90df489.tar.bz2 cygnal-73535010d72d1a7d46e4f5c6c98f41fab90df489.zip |
* cygpath.cc (main): Only setlocale for LC_CTYPE category. Fallback
to UTF-8 if locale is "C".
* ldd.cc (main): Ditto.
* mkgroup.c (main): Ditto.
* mkpasswd.c (main): Ditto.
* passwd.c (main): Ditto.
Diffstat (limited to 'winsup/utils/mkgroup.c')
-rw-r--r-- | winsup/utils/mkgroup.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/utils/mkgroup.c b/winsup/utils/mkgroup.c index 74de36c21..07d15fe5f 100644 --- a/winsup/utils/mkgroup.c +++ b/winsup/utils/mkgroup.c @@ -14,6 +14,7 @@ #include <stdlib.h> #include <wchar.h> #include <wctype.h> +#include <locale.h> #include <stdio.h> #include <unistd.h> #include <getopt.h> @@ -749,6 +750,10 @@ main (int argc, char **argv) if (!isatty (1)) setmode (1, O_BINARY); + /* Use locale from environment. If not set or set to "C", use UTF-8. */ + setlocale (LC_CTYPE, ""); + if (!strcmp (setlocale (LC_CTYPE, NULL), "C")) + setlocale (LC_CTYPE, "en_US.UTF-8"); load_dsgetdcname (); in_domain = fetch_primary_domain (); fetch_current_pgrp_sid (); |