From 6a1230de547fc142db844c6be030ff7164e1de47 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 19 Jan 2005 17:04:55 +0000 Subject: Added charset conversion in infobar --- src/gui/gui-common.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gui/gui-common.c') diff --git a/src/gui/gui-common.c b/src/gui/gui-common.c index 36cb5dda0..842bf4c74 100644 --- a/src/gui/gui-common.c +++ b/src/gui/gui-common.c @@ -299,17 +299,21 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...) static char buffer[1024]; va_list argptr; t_gui_infobar *ptr_infobar; - char *pos; + char *pos, *buf2; va_start (argptr, message); vsnprintf (buffer, sizeof (buffer) - 1, message, argptr); va_end (argptr); + buf2 = weechat_convert_encoding (cfg_look_charset_decode, + local_charset, + buffer); + ptr_infobar = (t_gui_infobar *)malloc (sizeof (t_gui_infobar)); if (ptr_infobar) { ptr_infobar->color = color; - ptr_infobar->text = strdup (buffer); + ptr_infobar->text = strdup (buf2); pos = strchr (ptr_infobar->text, '\n'); if (pos) pos[0] = '\0'; @@ -321,6 +325,8 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...) else wee_log_printf (_("%s not enough memory for infobar message\n"), WEECHAT_ERROR); + + free (buf2); } /* -- cgit v1.2.3