From f31899538d9cf548cecb8dcdd5fc2cb67893d832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Fri, 21 Nov 2008 15:42:26 +0000 Subject: [PATCH] Try to fix some problems when opening files with non-Ascii characters on Windows from the command line. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3263 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 7 +++++++ src/main.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 04bc1b56..8458c6d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-21 Enrico Tröger + + * src/main.c: + Try to fix some problems when opening files with non-Ascii characters + on Windows from the command line. + + 2008-11-21 Nick Treleaven * src/symbols.c: diff --git a/src/main.c b/src/main.c index 646e2cb0..07c6266d 100644 --- a/src/main.c +++ b/src/main.c @@ -774,7 +774,10 @@ static gboolean open_cl_files(gint argc, gchar **argv) for (i = 1; i < argc; i++) { gchar *filename = main_get_argv_filename(argv[i]); - +#ifdef G_OS_WIN32 + /* It seems argv elements are encoded in CP1252 on a German Windows */ + setptr(filename, g_locale_to_utf8(filename, -1, NULL, NULL, NULL)); +#endif if (filename && !main_handle_filename(filename)) { const gchar *msg = _("Could not find file '%s'.");