#if 0
printf("display_text: '%s', %d, %d, %d, %d %d\n", label, x, y, dx*0x10000/l, dy*0x10000/l, l);
#endif
- utf8=g_convert(label, -1, "utf8", "iso8859-1", NULL, NULL, NULL);
- gr->draw_text(gr, fg, bg, font, utf8, &p_t, dx*0x10000/l, dy*0x10000/l);
- g_free(utf8);
+ if(!g_utf8_validate(label,-1,NULL)){
+ gr->draw_text(gr, fg, bg, font, label, &p_t, dx*0x10000/l, dy*0x10000/l);
+ } else {
+ utf8=g_convert(label, -1, "utf8", "iso8859-1", NULL, NULL, NULL);
+ gr->draw_text(gr, fg, bg, font, utf8, &p_t, dx*0x10000/l, dy*0x10000/l);
+ g_free(utf8);
+ }
}
}
}
case 3:
p.x=list->p[0].x+3;
p.y=list->p[0].y+10;
- utf8=g_convert(list->label, -1, "utf8", "iso8859-1", NULL, NULL, NULL);
- gr->draw_text(gr, fg, bg, font, utf8, &p, 0x10000, 0);
- g_free(utf8);
+
+ if(g_utf8_validate(list->label,-1, NULL)){
+ utf8=g_convert(list->label, -1, "utf8", "iso8859-1", NULL, NULL, NULL);
+ gr->draw_text(gr, fg, bg, font, utf8, &p, 0x10000, 0);
+ g_free(utf8);
+ } else {
+ gr->draw_text(gr, fg, bg, font, list->label, &p, 0x10000, 0);
+ }
break;
}
}