]> granicus.if.org Git - curl/commitdiff
Peter Wullinger pointed out that curl should call setlocale() properly to
authorDaniel Stenberg <daniel@haxx.se>
Mon, 18 Oct 2004 13:37:18 +0000 (13:37 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 Oct 2004 13:37:18 +0000 (13:37 +0000)
initiate the specific language operations, to make the IDN stuff work better.

CHANGES
configure.ac
src/config.h.in
src/main.c

diff --git a/CHANGES b/CHANGES
index e21559b00d914679fb0cddb942d9af7bdfdc252f..226307e6b07baae79ec0c0fa865435902337e185 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   Changelog
 
+Daniel (18 October 2004)
+- Peter Wullinger pointed out that curl should call setlocale() properly to
+  initiate the specific language operations, to make the IDN stuff work
+  better.
+
 Version 7.12.2 (18 October 2004)
 
 Daniel (16 October 2004)
index 566f682a8f3a744d917ab4d9c14b5dbdf39bdaa7..a9aa7152901b39bab0a34291db0afb36ae66bba7 100644 (file)
@@ -1121,6 +1121,7 @@ AC_CHECK_HEADERS(
         sys/utime.h \
         sys/poll.h \
         libgen.h \
+        locale.h \
         setjmp.h,
 dnl to do if not found
 [],
@@ -1217,6 +1218,7 @@ AC_CHECK_FUNCS( strtoll \
                 utime \
                 sigsetjmp \
                 basename \
+                setlocale \
                 poll,
 dnl if found
 [],
index 3bd44ab889ea3ef1cf8702a7d81d7753f7aa9aa8..45eab369423b89476e2e10a4d4730dd448c82650 100644 (file)
 /* Define if you have the <limits.h> header file */
 #undef HAVE_LIMITS_H
 
+/* Define to 1 if you have the <locale.h> 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
 
index 86e06ccd331ebce0a6a97793ba9bd57395fed8a7..75a4355c1e9a337e650d1c2b7fbb59ea0959695d 100644 (file)
@@ -90,7 +90,7 @@
 #include <sys/utime.h>
 #endif
 
-#endif
+#endif /* HAVE_UTIME_H */
 
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #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");