summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-11-29 16:26:25 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-11-29 16:26:25 (GMT)
commit27aa537eef0dd848310938a5214909b070e92a1f (patch)
tree86f4773fb6bf419e002aad13d75042a232826343
parent8eca07090ea8ef74fa14e1d8aac2f53a01b65868 (diff)
parent20c0cdf51c6a9cb24182ba805ea2f0f1e87e0a24 (diff)
downloadtk-27aa537eef0dd848310938a5214909b070e92a1f.zip
tk-27aa537eef0dd848310938a5214909b070e92a1f.tar.gz
tk-27aa537eef0dd848310938a5214909b070e92a1f.tar.bz2
Merge 8.6
-rw-r--r--generic/tkUtil.c2
-rw-r--r--tests/font.test7
2 files changed, 7 insertions, 2 deletions
diff --git a/generic/tkUtil.c b/generic/tkUtil.c
index 098c286..1f574ec 100644
--- a/generic/tkUtil.c
+++ b/generic/tkUtil.c
@@ -1226,7 +1226,7 @@ TkUtfToUniChar(
/* 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 */
size_t len2 = Tcl_UtfToUniChar(src+len, &low);
- if ((uniChar & 0xFC00) == 0xDC00) {
+ if ((low & 0xFC00) == 0xDC00) {
*chPtr = (((uniChar & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000;
return len + len2;
}
diff --git a/tests/font.test b/tests/font.test
index 09c2dc6..a4e895f 100644
--- a/tests/font.test
+++ b/tests/font.test
@@ -11,6 +11,8 @@ namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+# Some tests require support for 4-byte UTF-8 sequences
+testConstraint fullutf [expr {[format %c 0x010000] != "\ufffd"}]
set defaultfontlist [font names]
@@ -152,11 +154,14 @@ test font-4.13 {font command: actual} -body {
font actual {-family times} -- \udc00
} -match glob -result {*}
test font-4.14 {font command: actual} -constraints win -body {
- font actual {-family times} -family -- \ud800\udc00
+ font actual {-family times} -family -- \uD800\uDC00
} -result {times}
test font-4.15 {font command: actual} -body {
font actual {-family times} -- \udc00\ud800
} -returnCodes 1 -match glob -result {expected a single character but got "*"}
+test font-4.16 {font command: actual} -constraints {fullutf win} -body {
+ font actual {-family times} -family -- \U10000
+} -result {times}
test font-5.1 {font command: configure} -body {