+#ifdef LC_NUMERIC
+ /* Get the grouping character from the locale. */
+ struct lconv *lconv;
+ const char *oldlocale = setlocale (LC_NUMERIC, "");
+ lconv = localeconv ();
+ loc_sepchar = *lconv->thousands_sep;
+ loc_grouping = xstrdup (lconv->grouping);
+ /* Restore the C locale semantics of printing and reading numbers */
+ setlocale (LC_NUMERIC, oldlocale);
+ if (!loc_sepchar)
+#endif
+ /* defaults for C locale or no locale */
+ loc_sepchar = ',', loc_grouping = "\x03";