summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-18 15:54:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-18 15:54:38 (GMT)
commit3c57d80efed172427e5aafa447365cb61439613c (patch)
tree339d7c229b1a90e597f5b585135a4ced4bba4f74 /generic/tclUtf.c
parent04004f3abcabe486568af1e7b026d03670b48ca8 (diff)
downloadtcl-3c57d80efed172427e5aafa447365cb61439613c.zip
tcl-3c57d80efed172427e5aafa447365cb61439613c.tar.gz
tcl-3c57d80efed172427e5aafa447365cb61439613c.tar.bz2
Fix [53cad613d8]: TIP 389 implementation makes Tk tests font-4.12 and font-4.15 fail. One more situation in which high surrogate causes problem
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 46ce4ef..c2963bf 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -189,6 +189,13 @@ Tcl_UniCharToUtf(
buf[0] = (char) ((ch >> 18) | 0xF0);
return 4;
}
+ } else if (ch == -1) {
+ if (((buf[0] & 0xF8) == 0xF0) && ((buf[1] & 0xC0) == 0x80)
+ && ((buf[2] & 0xCF) == 0)) {
+ ch = 0xD7C0 + ((buf[0] & 0x07) << 8) + ((buf[1] & 0x3F) << 2)
+ + ((buf[2] & 0x30) >> 4);
+ goto three;
+ }
#endif
}