diff options
| -rw-r--r-- | generic/tclEncoding.c | 2 | ||||
| -rw-r--r-- | tests/encoding.test | 3 |
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 |
