I'm getting the following warning from my application that uses gtk+:
(foo:11333): Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
the function that is emitting the warning is the following:
static void show_error(GtkWindow *parent, const gchar *fmt, ...)
{
GtkWidget *dialog;
va_list args;
va_start(args,fmt);
dialog = gtk_message_dialog_new(parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
fmt,
args);
(void)gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
va_end(args);
}
and I'm calling with ui_show_error(window, "error canno't read file %s", filename);
where filename is null-terminatted-string, that works fine to str*() and *printf() functions family.
How to fix this?
const char *s = "foo"; show_error(NULL, "%s baa", s);I get same warning message.show_error()call. I wrote a separate file to debug, I using the same code that I've posted in comments, that is giving same warning. My default language isn't english and contains accents.. is there some relation?show_error(NULL, "one:%d", 1);give me negative random values; something like thisone:-1079463944as if I'm accessing random memory.