diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2004-06-29 22:21:04 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2004-06-29 22:21:04 +0000 |
commit | 14ef5684fa17a81748c0971afc415f115b90adcb (patch) | |
tree | 1b8a13f9f4b2da65f3ea399e1a66891d51d0fd8d /gtk/simple_dialog.c | |
parent | 19c7f04794260e6bc54b837261673a4458cd99ee (diff) |
GTK2: convert character encoding from locale to UTF8
before displaying message
svn path=/trunk/; revision=11274
Diffstat (limited to 'gtk/simple_dialog.c')
-rw-r--r-- | gtk/simple_dialog.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk/simple_dialog.c b/gtk/simple_dialog.c index 987b503a52..386624b270 100644 --- a/gtk/simple_dialog.c +++ b/gtk/simple_dialog.c @@ -1,7 +1,7 @@ /* simple_dialog.c * Simple message dialog box routines. * - * $Id: simple_dialog.c,v 1.38 2004/06/18 07:41:21 ulfl Exp $ + * $Id: simple_dialog.c,v 1.39 2004/06/29 22:21:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -260,6 +260,7 @@ display_queued_messages(void) gpointer vsimple_dialog(ESD_TYPE_E type, gint btn_mask, const gchar *msg_format, va_list ap) { + gchar *vmessage; gchar *message; queued_message_t *queued_message; GtkWidget *win; @@ -268,7 +269,15 @@ vsimple_dialog(ESD_TYPE_E type, gint btn_mask, const gchar *msg_format, va_list #endif /* Format the message. */ - message = g_strdup_vprintf(msg_format, ap); + vmessage = g_strdup_vprintf(msg_format, ap); + +#if GTK_MAJOR_VERSION >= 2 + /* convert character encoding from locale to UTF8 (using iconv) */ + message = g_locale_to_utf8(vmessage, -1, NULL, NULL, NULL); + g_free(vmessage); +#else + message = vmessage; +#endif #if GTK_MAJOR_VERSION >= 2 if (top_level != NULL) { |