summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-01 14:53:58 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-01 14:53:58 (GMT)
commit87969cfb0ee1d53c7034f96f34cc443c7878c36c (patch)
tree537fee77602ad3ebfa081dbbf17510f1ea9f5533
parentc0381fd712c458f3b4ee476e00d0857bec4cf5cc (diff)
downloadtcl-87969cfb0ee1d53c7034f96f34cc443c7878c36c.zip
tcl-87969cfb0ee1d53c7034f96f34cc443c7878c36c.tar.gz
tcl-87969cfb0ee1d53c7034f96f34cc443c7878c36c.tar.bz2
Never mind remark about TIP #573 in previous commit: Test failure was due to typo. Fixed now.
-rw-r--r--generic/tclEncoding.c2
-rw-r--r--tests/encoding.test3
2 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 444f99e..ae02821 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2367,7 +2367,7 @@ UtfToUtfProc(
/* A surrogate character is detected, handle especially */
int low = *chPtr;
size_t len = (src <= srcEnd-3) ? TclUtfToUCS4(src, &low) : 0;
- if (((low & ~0x3FF) != 0xC00) || (*chPtr & 0x400)) {
+ if (((low & ~0x3FF) != 0xDC00) || (*chPtr & 0x400)) {
*dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF);
*dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF);
*dst++ = (char) ((*chPtr | 0x80) & 0xBF);
diff --git a/tests/encoding.test b/tests/encoding.test
index 04692b7..e313a29 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -36,7 +36,6 @@ proc runtests {} {
testConstraint testencoding [llength [info commands testencoding]]
testConstraint testbytestring [llength [info commands testbytestring]]
testConstraint teststringbytes [llength [info commands teststringbytes]]
-testConstraint ucs2 [expr {[format %c 0x010000] eq "\uFFFD"}]
testConstraint exec [llength [info commands exec]]
testConstraint testgetencpath [llength [info commands testgetencpath]]
@@ -322,7 +321,7 @@ test encoding-15.3 {UtfToUtfProc null character input} teststringbytes {
binary scan [teststringbytes $y] H* z
set z
} c080
-test encoding-15.4 {UtfToUtfProc emoji character input} -constraints ucs2 -body {
+test encoding-15.4 {UtfToUtfProc emoji character input} -body {
set x \xED\xA0\xBD\xED\xB8\x82
set y [encoding convertfrom utf-8 \xED\xA0\xBD\xED\xB8\x82]
list [string length $x] $y