From 73535010d72d1a7d46e4f5c6c98f41fab90df489 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 15 May 2009 11:30:18 +0000 Subject: * 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. --- winsup/utils/mkpasswd.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'winsup/utils/mkpasswd.c') diff --git a/winsup/utils/mkpasswd.c b/winsup/utils/mkpasswd.c index 0ba88bf75..3947309dd 100644 --- a/winsup/utils/mkpasswd.c +++ b/winsup/utils/mkpasswd.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -708,6 +709,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_user_sid (); -- cgit v1.2.3