#include #include #include #include /* * Creates a new string length bytes long filled with fill_char. * The returned string should be freed when no longer needed. */ gchar *utf8_strnfill(gsize length,gunichar fill_char) { int n,i; gchar *s; char utf8[6]; n=g_unichar_to_utf8(fill_char,utf8); s=g_new(gchar,length*n+1); if (n==1) memset(s,utf8[0],length); else for(i=0;i