1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

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
This commit is contained in:
Emanuele Giaquinta 2006-09-20 23:29:41 +00:00 committed by exg
parent f6f4941968
commit 4d9895ea77

View File

@ -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);