diff -r 000000000000 -r 466f43a12118 bl/utf8.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bl/utf8.c Wed Oct 02 23:51:18 2013 +0100 @@ -0,0 +1,24 @@ +#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