<p>I actually don't think they come from Scintilla but rather from the file browser plugin (or anything displaying file names) - I see these when some files are in invalid encoding (e.g. locale is using UTF-8 but the file on the disk is in different encoding). </p>

<p>The trouble is that utils_get_utf8_from_locale() fails to convert the invalid encoding to UTF-8 in which case this function just makes a copy of the original non-UTF-8 string. This string is then passed to Gtk which emits this error (when I was playing with locales I was even able to crash Geany because of this - Gtk expects all the strings it gets are valid UTF-8).</p>

<p>Maybe we should use something similar to g_filename_display_name () instead to make sure the output is always a valid UTF-8 string. The trouble might be this would make the conversion irreversible but with invalid encoding there will be other problems anyway.</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/issues/875#issuecomment-175868722">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ7yMyDJ_eR6igl3sXUegoJ8RgfJ1ks5peS-lgaJpZM4HInde.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/issues/875#issuecomment-175868722"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>