mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -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:
parent
f6f4941968
commit
4d9895ea77
@ -1,4 +1,5 @@
|
|||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
#include "recode.h"
|
||||||
|
|
||||||
MODULE = Irssi::TextUI::TextBuffer PACKAGE = Irssi
|
MODULE = Irssi::TextUI::TextBuffer PACKAGE = Irssi
|
||||||
PROTOTYPES: ENABLE
|
PROTOTYPES: ENABLE
|
||||||
@ -75,9 +76,13 @@ textbuffer_line_get_text(line, coloring)
|
|||||||
int coloring
|
int coloring
|
||||||
PREINIT:
|
PREINIT:
|
||||||
GString *str;
|
GString *str;
|
||||||
|
SV *result;
|
||||||
PPCODE:
|
PPCODE:
|
||||||
str = g_string_new(NULL);
|
str = g_string_new(NULL);
|
||||||
textbuffer_line2text(line, coloring, str);
|
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);
|
g_string_free(str, TRUE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user