From 82d6cfa7fcd03b477124b9cfcd7ce51646fe573e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 18 Oct 2004 13:37:18 +0000 Subject: Peter Wullinger pointed out that curl should call setlocale() properly to initiate the specific language operations, to make the IDN stuff work better. --- src/config.h.in | 6 ++++++ src/main.c | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/config.h.in b/src/config.h.in index 3bd44ab88..45eab3694 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -95,6 +95,12 @@ /* Define if you have the header file */ #undef HAVE_LIMITS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + /* type to use in place of socklen_t if not defined */ #undef socklen_t 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 #endif -#endif +#endif /* HAVE_UTIME_H */ #ifdef HAVE_LIMITS_H #include @@ -100,6 +100,10 @@ #include #endif +#ifdef HAVE_LOCALE_H +#include /* 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"); -- cgit v1.2.3