Hi,
I have a patch also concerned with ÿ characters being output.
Is this the same issue? If so, someone (upstream) should check
which is more correct; mine doesn’t “simply move an assignment”.
Thanks,
//mirabilos who definitely should forward his other screen bugfixes…
--
18:47⎜<mirabilos:#!/bin/mksh> well channels… you see, I see everything in the
same window anyway 18:48⎜<xpt:#!/bin/mksh> i know, you have some kind of
telnet with automatic pong 18:48⎜<mirabilos:#!/bin/mksh> haha, yes :D
18:49⎜<mirabilos:#!/bin/mksh> though that's more tinyirc – sirc is more comfy
# DP: cf. MirBSD commitid 1005EED581D59D2B04A
# DP: fixes Y-Tütü bug with doublewidth+combining character sequence
--- a/display.c
+++ b/display.c
@@ -603,7 +603,7 @@ int c;
D_x += D_AM ? 1 : -1;
D_mbcs = 0;
}
- else if (utf8_isdouble(c))
+ else if (utf8_isdouble_maybecomb(c))
{
D_mbcs = c;
D_x++;
--- a/encoding.c
+++ b/encoding.c
@@ -665,6 +665,14 @@ struct combchar {
};
struct combchar **combchars;
+int
+utf8_isdouble_maybecomb(int c)
+{
+ while (c >= 0xd800 && c < 0xe000 && combchars && combchars[c - 0xd800])
+ c = combchars[c - 0xd800]->c1;
+ return utf8_isdouble(c);
+}
+
void
AddUtf8(c)
int c;
--- a/extern.h
+++ b/extern.h
@@ -487,6 +487,7 @@ extern int FromUtf8 __P((int, int *));
extern void AddUtf8 __P((int));
extern int ToUtf8 __P((char *, int));
extern int ToUtf8_comb __P((char *, int));
+extern int utf8_isdouble_maybecomb __P((int));
extern int utf8_isdouble __P((int));
extern int utf8_iscomb __P((int));
extern void utf8_handle_comb __P((int, struct mchar *));