From d30a9fe66f53affdf3e01141996572a9448a10fc Mon Sep 17 00:00:00 2001 From: Chyla Zbigniew Date: Sat, 25 Aug 2001 14:21:41 +0000 Subject: Convert UTF-8 strings to locale's encoding before putting them in canvas * e-table-group-container.c (compute_text): Convert UTF-8 strings to locale's encoding before putting them in canvas item. svn path=/trunk/; revision=12472 --- widgets/table/e-table-group-container.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index ce10fbf9a8..8eca550d6b 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -20,6 +20,7 @@ #include "gal/util/e-util.h" #include "gal/widgets/e-canvas.h" #include "gal/widgets/e-canvas-utils.h" +#include "gal/widgets/e-unicode.h" #include "gal/e-text/e-text.h" #include "e-table-defines.h" @@ -331,20 +332,27 @@ etgc_unrealize (GnomeCanvasItem *item) static void compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_node) { - gchar *text; - if (etgc->ecol->text) + gchar *text, *s1, *s2; + + if (etgc->ecol->text) { + s1 = e_utf8_to_locale_string (etgc->ecol->text); + s2 = e_utf8_to_locale_string (child_node->string); text = g_strdup_printf ((child_node->count == 1) ? _("%s : %s (%d item)") : _("%s : %s (%d items)"), - etgc->ecol->text, - child_node->string, + s1, s2, (gint) child_node->count); - else + g_free (s1); + g_free (s2); + } else { + s1 = e_utf8_to_locale_string (child_node->string); text = g_strdup_printf ((child_node->count == 1) ? _("%s (%d item)") : _("%s (%d items)"), - child_node->string, + s1, (gint) child_node->count); + g_free (s1); + } gnome_canvas_item_set (child_node->text, "text", text, NULL); -- cgit v1.2.3