<p>Apart from this, my limited WINAPI knowledge suggests it's mostly OK.  Though, <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd319072%28v=vs.85%29.aspx">the MSDN docs</a> states that MultiByteToWideWhar can also return U+FFFD on invalid input:</p>

<blockquote>
<p>If the input byte/char sequences are invalid, returns U+FFFD for UTF encodings. </p>
</blockquote>

<p>Maybe this should be handled too?</p>

<p><a href="https://github.com/zhekov" class="user-mention">@zhekov</a> if you don't mind, can we get your opinion on this?</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/809#issuecomment-164451057">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ15SOu9psRgUI5btdC8TcJpnVKejks5pPsmPgaJpZM4G0VWF.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/809#issuecomment-164451057"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>