blob: 50f48e9601e5e895031c1c9773999167c9f21fe3 [file] [log] [blame]
--- popt-1.16/src/poptint.c.orig 2010-01-19 04:39:10 +0400
+++ popt-1.16/src/poptint.c 2012-05-05 22:02:40 +0400
@@ -86,8 +86,20 @@
if (istr == NULL)
return NULL;
-#ifdef HAVE_LANGINFO_H
+#if defined(HAVE_LANGINFO_H)
+# if !defined(WIN32)
codeset = nl_langinfo ((nl_item)CODESET);
+# else
+ {
+ static char __langinfo[251];
+ unsigned int cp = GetACP();
+ if (cp)
+ sprintf(__langinfo, "CP%u", cp);
+ else
+ strcpy(__langinfo, "UTF-8"); /* ? */
+ codeset = __langinfo;
+ }
+# endif
#endif
if (codeset != NULL && strcmp(codeset, "UTF-8") != 0