Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not convert filename when opening files from command line on Windows #2660

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/libmain.c
Expand Up @@ -330,6 +330,9 @@ gchar *main_get_argv_filename(const gchar *filename)
else
cur_dir = g_strdup(original_cwd);

#ifdef G_OS_WIN32
SETPTR(cur_dir, g_locale_from_utf8(cur_dir, -1, NULL, NULL, NULL));
#endif
result = g_strjoin(
G_DIR_SEPARATOR_S, cur_dir, filename, NULL);
g_free(cur_dir);
Expand Down Expand Up @@ -886,6 +889,10 @@ static void open_cl_files(gint argc, gchar **argv)
continue;
}

#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'.");
Expand Down