aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--TODO4
-rw-r--r--src/Makefile.am6
-rw-r--r--src/main.c13
3 files changed, 18 insertions, 5 deletions
diff --git a/TODO b/TODO
index e5d2bf4..c0ff79a 100644
--- a/TODO
+++ b/TODO
@@ -149,10 +149,6 @@ Known Bugs:
Automatically running EF EB...$ in the "save" hook could
also have unwanted side effects.
* session.vcs does not properly work in MSYS2 environments.
- * Win32: Unicode CI tests sometimes spuriously fail due to
- "Command line contains characters that are not supported
- in the active code page (1252)."
- Apparently I am not the only user with this bug.
Features:
* Auto-indention could be implemented via context-sensitive
diff --git a/src/Makefile.am b/src/Makefile.am
index 5b2572e..1e2056e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -86,8 +86,12 @@ sciteco_LDADD = $(sciteco_minimal_LDADD)
# see above
nodist_EXTRA_sciteco_SOURCES = fuck-this-shit.cpp
-# For MinGW: Compile in resource (contains the icon)
if WIN32
+# Prevent MinGW from failing on non-Unicode command lines that cannot
+# be converted into the system code page.
+AM_LDFLAGS += -municode
+
+# Compile in resource (contains the icon)
sciteco_SOURCES += sciteco.rc
.rc.o:
@RC@ $< $@
diff --git a/src/main.c b/src/main.c
index 892f15c..4d0e4e9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <signal.h>
#include <locale.h>
+#include <wchar.h>
#include <glib.h>
#include <glib/gprintf.h>
@@ -299,8 +300,20 @@ teco_sigint_handler(int signal)
teco_interrupted = TRUE;
}
+#ifdef G_OS_WIN32
+/*
+ * We are linking with -municode, since MinGW could otherwise
+ * fail trying to convert Unicode command lines into the system locale.
+ * We still don't use argv since g_win32_get_command_line() returns
+ * an UTF-8 version.
+ * The alternative would be compiling in a manifest.
+ */
+int
+wmain(int argc, wchar_t **argv)
+#else
int
main(int argc, char **argv)
+#endif
{
g_autoptr(GError) error = NULL;