GTK解决Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()问题
解决方法:
使用g_locale_to_utf8()函数
gchar* g_locale_to_utf8 (const gchar *opsysstring,
gssize len,
gsize *bytes_read,
gsize *bytes_written,
GError **error) G_GNUC_MALLOC;
自己封装起来:
char *_(char *c)
{
return g_locale_to_utf8(c,-1,NULL,NULL,NULL);
}
后面调用:
glist = g_list_append(glist,_("请选择"));
glist = g_list_append(glist,_("数学"));