summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-01 16:39:49 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-01 16:39:49 (GMT)
commit226ae51f58137fc6d818f72dfe25a2d123f30f2c (patch)
tree6552f311fad9455ad216ba98b309f56534080b8e /generic
parent27aa537eef0dd848310938a5214909b070e92a1f (diff)
parent2156b8f27a1daba1ff6be50810e837283b9ec589 (diff)
downloadtk-226ae51f58137fc6d818f72dfe25a2d123f30f2c.zip
tk-226ae51f58137fc6d818f72dfe25a2d123f30f2c.tar.gz
tk-226ae51f58137fc6d818f72dfe25a2d123f30f2c.tar.bz2
Merge 8.6. When compiling against Tcl 9.0 headers, don't allow Emoji escape sequences to be split into two surrugates any more.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkUtil.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tkUtil.c b/generic/tkUtil.c
index 1f574ec..bae589f 100644
--- a/generic/tkUtil.c
+++ b/generic/tkUtil.c
@@ -1221,7 +1221,12 @@ TkUtfToUniChar(
Tcl_UniChar uniChar = 0;
size_t len = Tcl_UtfToUniChar(src, &uniChar);
- if ((uniChar & 0xFC00) == 0xD800) {
+ if ((sizeof(Tcl_UniChar) == 2)
+ && ((uniChar & 0xFC00) == 0xD800)
+#if TCL_MAJOR_VERSION > 8
+ && len == 1;
+#endif
+ ) {
Tcl_UniChar low = uniChar;
/* This can only happen if Tcl is compiled with TCL_UTF_MAX=4,
* or when a high surrogate character is detected in UTF-8 form */