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

<ol>
<li>
<p>mscvrt often breaks unquoted locale strings on 2 or more pieces.</p>

<p>Fix: spawn should quote all arguments. Currently is passes arguments without " or isspace() as-is. There are no drawbacks in quoting all anyway.</p>
</li>
<li>
<p>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.</p>

<p>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...</p>
</li>
</ol>

<p>Of course, if we <em>really</em> 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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/pull/637#issuecomment-138571165">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJzko617O85pH0sayxGu8Eje4iQX_ks5ovuQJgaJpZM4F1KFb.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/637#issuecomment-138571165"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>