36 lines
719 B
Diff
36 lines
719 B
Diff
--- mtools-4.0.43/charsetConv.c.orig 2023-06-10 13:22:46.034078400 +1000
|
|
+++ mtools-4.0.43/charsetConv.c 2023-06-10 13:23:47.508574700 +1000
|
|
@@ -326,7 +326,11 @@
|
|
|
|
#ifdef HAVE_ICONV_H
|
|
|
|
-#include <langinfo.h>
|
|
+#if defined(_WIN32)
|
|
+# include <windows.h>
|
|
+#else
|
|
+# include <langinfo.h>
|
|
+#endif
|
|
|
|
static iconv_t to_native = NULL;
|
|
|
|
@@ -336,7 +340,19 @@
|
|
size_t len;
|
|
if(to_native != NULL)
|
|
return;
|
|
+#if !defined(_WIN32)
|
|
li = nl_langinfo(CODESET);
|
|
+#else
|
|
+ {
|
|
+ static char __langinfo[251];
|
|
+ unsigned int cp = GetACP();
|
|
+ if (cp)
|
|
+ sprintf(__langinfo, "CP%u", cp);
|
|
+ else
|
|
+ strcpy(__langinfo, "UTF-8"); /* ? */
|
|
+ li = __langinfo;
|
|
+ }
|
|
+#endif
|
|
len = strlen(li) + 11;
|
|
if(getWcharCp() == NULL)
|
|
exit(1);
|