title: How to get an exact size of a GtkTextBuffer in bytes?
body: <p>At the present time I'm doing it like:</p>
  
  <pre><code>GtkTextBuffer *buf = gtk_text_view_get_buffer(...);
  gtk_text_buffer_get_bounds(buf, &amp;start, &amp;end);
  gchar *data = gtk_text_buffer_get_text(buf, &amp;start, &amp;end, true);
  gint size = strlen(data); // ouch
  </code></pre>
  
  <p>But this is rather ugly. I found (and tested) <code>gtk_text_iter_get_offset()</code> but it returns the size in <em>characters</em>, not physical bytes.</p>