mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 16:12:30 +02:00
expose wcwidth and related to perl
This commit is contained in:
parent
60d2364989
commit
9e5e5d8625
2 changed files with 42 additions and 0 deletions
|
|
@ -205,6 +205,27 @@ gui_input_set_pos(pos)
|
|||
CODE:
|
||||
gui_entry_set_pos(active_entry, pos);
|
||||
|
||||
int
|
||||
wcwidth(c)
|
||||
char *c
|
||||
CODE:
|
||||
if (term_type == TERM_TYPE_UTF8) {
|
||||
unichar chr = g_utf8_get_char_validated((const char *) c, -1);
|
||||
|
||||
if (chr & 0x80000000) {
|
||||
RETVAL = 1;
|
||||
} else {
|
||||
RETVAL = i_wcwidth(chr);
|
||||
}
|
||||
} else if (term_type != TERM_TYPE_BIG5 ||
|
||||
c[1] == '\0' || !is_big5(c[0], c[1])) {
|
||||
RETVAL = 1;
|
||||
} else {
|
||||
RETVAL = 2;
|
||||
}
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
MODULE = Irssi::TextUI PACKAGE = Irssi::UI::Window
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue