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?