how about the following modifications? Change "gstring.h": ... struct _GString { gchar *str; gsize len; gsize allocated_len; gsize utf8_len; }; ...