From e4c1bf052f3292b8ded9e2010c051b7f62aee95a Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 26 Apr 2020 20:49:43 +0000 Subject: Tests demonstrating the bug. Work on a fix can go here. --- tests/utf.test | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/utf.test b/tests/utf.test index b588976..3ff7d47 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -78,6 +78,14 @@ test utf-1.12 {Tcl_UniCharToUtf: 4 byte sequence, high/low surrogate} {pairsTo4b test utf-1.13 {Tcl_UniCharToUtf: Invalid surrogate} {Uesc testbytestring} { expr {"\UD842" eq [testbytestring "\xEF\xBF\xBD"]} } 1 +test utf-1.14 {Tcl_UniCharToUtf: surrogate pairs from concat} {pairsTo4bytes testbytestring} { + set hi \uD842 + set lo \uDC42 + eq "$hi$lo" [testbytestring \xF0\xA0\xA1\x92] +} 1 +test utf-1.15 {Tcl_UniCharToUtf: surrogate pairs from concat} {pairsTo4bytes testbytestring} { + eq [string cat \uD842 \uDC42] [testbytestring \xF0\xA0\xA1\x92] +} 1 test utf-2.1 {Tcl_UtfToUniChar: low ascii} { string length "abc" -- cgit v0.12