[Github-comments] [geany] Fix for "Open in New Window". (#637)

zhekov notifications at xxxxx
Tue Sep 8 14:11:21 UTC 2015


While trying to fix the encoding for New Window under Win32, I found some unpleasant things:

1. mscvrt often breaks unquoted locale strings on 2 or more pieces.

   Fix: spawn should quote all arguments. Currently is passes arguments without " or isspace() as-is. There are no drawbacks in quoting all anyway.

2. utils_get_locale_from_utf8() does not work for spawn, because it does nothing under Win~1. That's fine for most GLib functions, which convert between UTF-8 and UNICODE automatically, but not for g_spawn (and spawn): they don't know which arguments (or even parts of them) to convert, and the receiving program may be "ANSI" anyway.

   Fix: use g_locale_from_utf8(), and handle the result properly. Passing the UTF-8 value for a string that can't be localized rarely makes sense, if at all. The other spawn invocations should be checked as well...

Of course, if we *really* want to fix the locale file name handling in Geany, which is severely broken (as in almost all gtk+ programs), that will be an entirely different matter altogether, and should be discussed in the mailing list, for everyone to see.


---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/637#issuecomment-138571165
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20150908/a0687acd/attachment.html>


More information about the Github-comments mailing list