From 4d9895ea779cb782b25a039318d2d37f1fa46bc1 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Wed, 20 Sep 2006 23:29:41 +0000 Subject: [PATCH] Add support for utf8 to Irssi::TextUI::Line::get_text. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4371 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/perl/textui/TextBuffer.xs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/perl/textui/TextBuffer.xs b/src/perl/textui/TextBuffer.xs index 4fb92f11..91a77a80 100644 --- a/src/perl/textui/TextBuffer.xs +++ b/src/perl/textui/TextBuffer.xs @@ -1,4 +1,5 @@ #include "module.h" +#include "recode.h" MODULE = Irssi::TextUI::TextBuffer PACKAGE = Irssi PROTOTYPES: ENABLE @@ -75,9 +76,13 @@ textbuffer_line_get_text(line, coloring) int coloring PREINIT: GString *str; + SV *result; PPCODE: str = g_string_new(NULL); textbuffer_line2text(line, coloring, str); - XPUSHs(sv_2mortal(new_pv(str->str))); + result = new_pv(str->str); + if (is_utf8()) + SvUTF8_on(result); + XPUSHs(sv_2mortal(result)); g_string_free(str, TRUE);