I wonder, what makes this Windows-specific? On-disk file names can be arbitrary
encoding on all platforms, right?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1258#issuecomment-29560702
@cshu still interested in this PR?
I think it would be cool and the sooner we get it merged (regarding the next
release) the better it is.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1
@eht16 No, I leave it to you. This PR is a small change.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1258#issuecomment-264706407
eht16 commented on this pull request.
> +{
+ int num_arg;
+ LPWSTR *szarglist = CommandLineToArgvW(GetCommandLineW(), &num_arg);
+ char **utf8argv = g_new0(char *, num_arg + 1);
+ int i = num_arg;
+ while(i)
+ {
+ i--;
+ utf8argv[i]
eht16 commented on this pull request.
> @@ -1231,6 +1230,9 @@ gint main_lib(gint argc, gchar **argv)
#endif
gtk_main();
+#ifdef G_OS_WIN32
+ win32_free_argv_made_in_utf8(argc, argv);
Yeah, also nice. But I'd still vote to put the Windows specific code in the
first G_OS_WIN32 b
b4n commented on this pull request.
> @@ -1032,4 +1032,31 @@ gchar *win32_get_user_config_dir(void)
return g_build_filename(g_get_user_config_dir(), "geany", NULL);
}
+
+void win32_make_argc_and_argv_in_utf8(gint *pargc, gchar ***pargv)
+{
+ int num_arg;
+ LPWSTR *szarglis
codebrainz commented on this pull request.
> @@ -1032,4 +1032,31 @@ gchar *win32_get_user_config_dir(void)
return g_build_filename(g_get_user_config_dir(), "geany", NULL);
}
+
+void win32_make_argc_and_argv_in_utf8(gint *pargc, gchar ***pargv)
+{
+ int num_arg;
+ LPWSTR *s
b4n commented on this pull request.
> @@ -1032,4 +1032,31 @@ gchar *win32_get_user_config_dir(void)
return g_build_filename(g_get_user_config_dir(), "geany", NULL);
}
+
+void win32_make_argc_and_argv_in_utf8(gint *pargc, gchar ***pargv)
+{
+ int num_arg;
+ LPWSTR *szarglis
codebrainz commented on this pull request.
> @@ -1032,4 +1032,31 @@ gchar *win32_get_user_config_dir(void)
return g_build_filename(g_get_user_config_dir(), "geany", NULL);
}
+
+void win32_make_argc_and_argv_in_utf8(gint *pargc, gchar ***pargv)
+{
+ int num_arg;
+ LPWSTR *s
> (Or we could please @codebrainz and rewrite using GApplication which does
> this for us… but that would be a lot of changes :))
or maybe qapplication ;-P
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/
Hum, the [docs on
`g_win32_get_command_line()`](https://developer.gnome.org/glib/unstable/glib-Windows-Compatibility-Functions.html#g-win32-get-command-line)
mention that
[`g_option_context_parse()`](https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#g-option-context-p
b4n commented on this pull request.
> @@ -1032,4 +1032,31 @@ gchar *win32_get_user_config_dir(void)
return g_build_filename(g_get_user_config_dir(), "geany", NULL);
}
+
+void win32_make_argc_and_argv_in_utf8(gint *pargc, gchar ***pargv)
Actually recent GLib (2.40+) have `g_win32_get_
b4n requested changes on this pull request.
The idea seems good, and without having actually tested the PR I can confirm
from other tests I did yetserday that the combination of `GetCommandLineW()`
and `CommandLineToArgvW()` seems to work just fine.
> +{
+ int num_arg;
+ LPWSTR *sza
eht16 requested changes on this pull request.
Thanks for the hints for reproducing. After being able to reproduce the issue
and testing your changes, it worked fine.
Thanks.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
eht16 commented on this pull request.
> @@ -1032,4 +1032,31 @@ gchar *win32_get_user_config_dir(void)
return g_build_filename(g_get_user_config_dir(), "geany", NULL);
}
+
+void win32_make_argc_and_argv_in_utf8(gint *pargc, gchar ***pargv)
Maybe `win32_convert_argv_to_utf8()` would be
I moved most code to win32.c, and included argv[0] in conversion.
Different file systems can use various encoding for filenames. (NTFS, FAT32,
etc.) But `CommandLineToArgvW` always provide filenames in UTF-16. So in the
case of windows api functions, underlying file system usually should not be
@cshu pushed 1 commit.
e9e7c11 most-logic-in-win32
--
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/geany/geany/pull/1258/files/1dd0769d7ea77eb54af0a61238370c95e56cec9f..e9e7c117be223e23e05ea9e0f97b00ecb17a4afc
In the initial description you talk about "unicode". Unicode characters can be
saved using different encodings, this can be UTF-8, UTF-16 and so on. We cannot
know which encoding the filename of a file on disk was used.
Yes, we can assume UTF-16 or we can assume UTF-8, maybe even both by trying.
This can be reproduced when filename character is not supported by system
locale's encoding.
E.g. When system locale is "English (United States)", double clicking
`read我.txt` opens an empty tab in Geany with name `read?.txt`. The file is not
really opened.
--
You are receiving this because you
I think we should handle the argv[0] issue as well. But only if it is necessary
at all, see below.
Can you provide a test case for this?
I can open files on a NTFS drive with non-ASCII characters in their path in
Geany either from the command line (cmd.exe) as well as using the "Open With"
Expl
I created the pull request mainly for the convenience of "open with" Geany on
Windows
On the other hand it should be very rare for Geany's installation path to
contain unicode character.
And I'd like to let geany launch as fast as possible when I press Win+R and
type `geany`. So I avoided the c
I'm not sure if it's necessary but have you checked you don't have to handle
argv[0] the same way ?
(Eg geany is in an directory containing unicode characters)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.c
Should work, regardless of locale settings.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1258#issuecomment-251909482
Does this work if the locale is a non-unicode code page?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1258#issuecomment-251900323
Windows filenames (NTFS) may contain unicode characters. Passing the filename
to `geany.exe` as command line argument does not open the file.
At startup, it can get all arguments in UTF-16, and convert them to UTF-8. So
filenames containing unicode characters can be passed to `geany.exe`.
You ca
25 matches
Mail list logo