+2008-06-19 Xavier Saint <wget@sxav.eu>
+
+ * iri.c, iri.h : Add a new function find_locale() to find
+ out the local system encoding.
+
+ * main.c : Make use of find_locale().
+
2008-06-19 Xavier Saint <wget@sxav.eu>
* html-url.c : Add "content-type" meta tag parsing for
}
+/* Find the locale used, or fall back on a default value */
+char *
+find_locale (void)
+{
+ /* sXXXav, made our own function or use libidn one ?! */
+ return stringprep_locale_charset ();
+}
+
+
#ifdef ENABLE_IRI
char *parse_charset (char *str);
-
+char *find_locale (void);
#else /* ENABLE_IRI */
#define parse_charset(str) NULL
+#define find_locale() NULL
#endif /* ENABLE_IRI */
#endif /* IRI_H */
#include "convert.h"
#include "spider.h"
#include "http.h" /* for save_cookies */
+#include "iri.h"
#include <getopt.h>
#include <getpass.h>
if (opt.enable_iri)
{
if (!opt.locale)
- {
- opt.locale = getenv ("CHARSET");
+ opt.locale = find_locale ();
- if (opt.locale == NULL)
- opt.locale = nl_langinfo(CODESET);
- }
- else
- {
- /* sXXXav : check given locale */
- logprintf (LOG_VERBOSE, "Check the locale...\n");
- }
+ /* sXXXav : check given locale and remote encoding */
+
+ logprintf (LOG_VERBOSE, "Locale = %s\n", quote (opt.locale));
}
#else
if (opt.enable_iri || opt.locale || opt.encoding_remote)