aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 86e06ccd3..75a4355c1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -90,7 +90,7 @@
#include <sys/utime.h>
#endif
-#endif
+#endif /* HAVE_UTIME_H */
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -100,6 +100,10 @@
#include <sys/poll.h>
#endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h> /* for setlocale() */
+#endif
+
#define ENABLE_CURLX_PRINTF
/* make the curlx header define all printf() functions to use the curlx_*
versions instead */
@@ -2790,6 +2794,11 @@ operate(struct Configurable *config, int argc, char *argv[])
errorbuffer[0]=0; /* prevent junk from being output */
+ /* setup proper locale from environment */
+#ifdef HAVE_SETLOCALE
+ setlocale(LC_ALL, "");
+#endif
+
/* inits */
if (main_init() != CURLE_OK) {
helpf("error initializing curl library\n");