diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2006-09-20 23:29:41 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2006-09-20 23:29:41 +0000 |
commit | 4d9895ea779cb782b25a039318d2d37f1fa46bc1 (patch) | |
tree | 1d523dd48cd8a1cbfcf3de139b30c04dcae7ca3b /src/perl | |
parent | f6f49419683c2943dbce6c36ffa62ebd6bec4b80 (diff) | |
download | irssi-4d9895ea779cb782b25a039318d2d37f1fa46bc1.zip |
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
Diffstat (limited to 'src/perl')
-rw-r--r-- | src/perl/textui/TextBuffer.xs | 7 |
1 files changed, 6 insertions, 1 deletions
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); |