<p>In <a href="https://github.com/geany/geany/pull/621#discussion_r40507696">src/document.c</a>:</p>
<pre style='color:#555'>>      {
>            ui_set_statusbar(TRUE, "%s", err->message);
>            g_error_free(err);
>            return FALSE;
>    }
>  
> -  filedata->len = (gsize) st.st_size;
</pre>
<p>Hmm, just checked too and it's also related to</p>

<p><a href="https://github.com/geany/geany/commit/f60ead793d4435b8bd126519f093aef66b73a236" class="commit-link"><tt>f60ead7</tt></a></p>

<p>where size was moved to encodings.c and inside handle_buffer() (called from encodings_convert_to_utf8_auto()) it appears it distinguishes between len and size. So at least for encodings_convert_to_utf8_auto() we should actually use the value from stat(). Will try to fix.</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/621/files#r40507696">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ28o2qgux1LFVWw-p13U2DEeCf3-ks5o2C_WgaJpZM4FwLm6.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/621/files#r40507696"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>