diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-28 06:54:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-28 06:54:05 (GMT) |
commit | 15b634b5e53cbe2414e4f73a679522c70631c6cd (patch) | |
tree | 5fc9ec91effafa406bda821080fded62c59b0734 | |
parent | 215662c8ba97ab0ec4818e0b0bb0440be801219f (diff) | |
download | tcl-15b634b5e53cbe2414e4f73a679522c70631c6cd.zip tcl-15b634b5e53cbe2414e4f73a679522c70631c6cd.tar.gz tcl-15b634b5e53cbe2414e4f73a679522c70631c6cd.tar.bz2 |
Backport parsing of surrogate-pair change from 8.6 (only for TCL_UTF_MAX=4)
Adapt test-cases accordingly. Renumber and split testcases, making the numbering more equal to the numbering in 8.6/8.7/9.0
-rw-r--r-- | generic/tclParse.c | 18 | ||||
-rw-r--r-- | tests/utf.test | 192 |
2 files changed, 126 insertions, 84 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c index cfd6337..0b9b14f 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -912,7 +912,7 @@ TclParseBackslash( count += ParseHex(p+1, numBytes-2, &result); if (count == 2) { /* - * No hexadigits -> This is just "x". + * No hexdigits -> This is just "x". */ result = 'x'; @@ -927,9 +927,21 @@ TclParseBackslash( count += ParseHex(p+1, (numBytes > 5) ? 4 : numBytes-2, &result); if (count == 2) { /* - * No hexadigits -> This is just "u". + * No hexdigits -> This is just "u". */ result = 'u'; +#if TCL_UTF_MAX > 3 + } else if (((result & 0xDC00) == 0xD800) && (count == 6) + && (p[5] == '\\') && (p[6] == 'u') && (numBytes >= 10)) { + /* If high surrogate is immediately followed by a low surrogate + * escape, combine them into one character. */ + int low; + int count2 = ParseHex(p+7, 4, &low); + if ((count2 == 4) && ((low & 0xDC00) == 0xDC00)) { + result = ((result & 0x3FF)<<10 | (low & 0x3FF)) + 0x10000; + count += count2 + 2; + } +#endif } break; #if TCL_UTF_MAX > 3 @@ -937,7 +949,7 @@ TclParseBackslash( count += ParseHex(p+1, (numBytes > 9) ? 8 : numBytes-2, &result); if (count == 2) { /* - * No hexadigits -> This is just "U". + * No hexdigits -> This is just "U". */ result = 'U'; } else if ((result | 0x7FF) == 0xDFFF) { diff --git a/tests/utf.test b/tests/utf.test index ea13d1d..0e769e3 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -105,7 +105,7 @@ test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestrin test utf-2.8.0 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs2} { string length [testbytestring "\xF0\x90\x80\x80"] } 4 -test utf-2.8.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs4} { +test utf-2.8.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring fullutf} { string length [testbytestring "\xF0\x90\x80\x80"] } 1 test utf-2.8.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring tip389} { @@ -114,7 +114,7 @@ test utf-2.8.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytest test utf-2.9.0 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs2} { string length [testbytestring "\xF4\x8F\xBF\xBF"] } 4 -test utf-2.9.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs4} { +test utf-2.9.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring fullutf} { string length [testbytestring "\xF4\x8F\xBF\xBF"] } 1 test utf-2.9.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring tip389} { @@ -150,32 +150,32 @@ test utf-4.5 {Tcl_NumUtfChars: zero length, calc len} testnumutfchars { testnumutfchars "" 0 } 0 test utf-4.6 {Tcl_NumUtfChars: length 1, calc len} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\xC2\xA2"] 1 + testnumutfchars [testbytestring "\xC2\xA2"] end } 1 test utf-4.7 {Tcl_NumUtfChars: long string, calc len} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "abc\xC2\xA2\xE4\xB9\x8E\xA2\x4E"] 10 + testnumutfchars [testbytestring "abc\xC2\xA2\xE4\xB9\x8E\xA2\x4E"] end } 7 test utf-4.8 {Tcl_NumUtfChars: #u0000, calc len} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\xC0\x80"] 1 + testnumutfchars [testbytestring "\xC0\x80"] end } 1 # Bug [2738427]: Tcl_NumUtfChars(...) no overflow check test utf-4.9 {Tcl_NumUtfChars: #u20AC, calc len, incomplete} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\xE2\x82\xAC"] 2 + testnumutfchars [testbytestring "\xE2\x82\xAC"] end-1 } 2 test utf-4.10 {Tcl_NumUtfChars: #u0000, calc len, overcomplete} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "\x00"] 2 + testnumutfchars [testbytestring "\x00"] end+1 } 2 test utf-4.11 {Tcl_NumUtfChars: 3 bytes of 4-byte UTF-8 characater} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring \xF0\x9F\x92\xA9] 3 + testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end-1 } 3 test utf-4.12.0 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring ucs2} { - testnumutfchars [testbytestring \xF0\x9F\x92\xA9] 4 + testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end } 4 test utf-4.12.1 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring ucs4} { - testnumutfchars [testbytestring \xF0\x9F\x92\xA9] 4 + testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end } 1 test utf-4.12.2 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring tip389} { - testnumutfchars [testbytestring \xF0\x9F\x92\xA9] 4 + testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end } 2 test utf-5.1 {Tcl_UtfFindFirst} {testfindfirst testbytestring} { @@ -487,52 +487,58 @@ test utf-6.90.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext fullutf} test utf-6.91 {Tcl_UtfNext, validity check [493dccc2de]} testutfnext { testutfnext \xF4\x90\x80\x80 } 1 -test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} testutfnext { +test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} testutfnext { testutfnext \xA0\xA0\xA0 } 1 test utf-6.93 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} testutfnext { testutfnext \x80\x80\x80 } 1 -test utf-6.94 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.94 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext { + testutfnext \xA0\xA0\xA0\xA0 +} 1 +test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext { + testutfnext \x80\x80\x80\x80 +} 1 +test utf-6.96 {Tcl_UtfNext, read limits} testutfnext { testutfnext G 0 } 0 -test utf-6.95 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.97 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0 0 } 0 -test utf-6.96 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.98 {Tcl_UtfNext, read limits} testutfnext { testutfnext AG 1 } 1 -test utf-6.97 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.99 {Tcl_UtfNext, read limits} testutfnext { testutfnext A\xA0 1 } 1 -test utf-6.98 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.100 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xD0\xA0G 1 } 0 -test utf-6.99 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.101 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xD0\xA0G 2 } 2 -test utf-6.100 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.102 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xD0\xA0\xA0 1 } 0 -test utf-6.101 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.103 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xD0\xA0\xA0 2 } 2 -test utf-6.102 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.104 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xE8\xA0\xA0G 1 } 0 -test utf-6.103 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.105 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xE8\xA0\xA0G 2 } 0 -test utf-6.104 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.106 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xE8\xA0\xA0G 3 } 3 -test utf-6.105 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.107 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xE8\xA0\xA0\xA0 1 } 0 -test utf-6.106 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.108 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xE8\xA0\xA0\xA0 2 } 0 -test utf-6.107 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.109 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xE8\xA0\xA0\xA0 3 } 3 test utf-6.108.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { @@ -541,81 +547,75 @@ test utf-6.108.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { test utf-6.108.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { testutfnext \xF2\xA0\xA0\xA0G 1 } 0 -test utf-6.109.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { +test utf-6.110.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G 2 } 1 -test utf-6.109.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.110.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { testutfnext \xF2\xA0\xA0\xA0G 2 } 0 -test utf-6.110.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { +test utf-6.111.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G 3 } 1 -test utf-6.110.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.111.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { testutfnext \xF2\xA0\xA0\xA0G 3 } 0 -test utf-6.111.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { +test utf-6.112.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0G 4 } 1 -test utf-6.111.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.112.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { testutfnext \xF2\xA0\xA0\xA0G 4 } 4 -test utf-6.112.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { +test utf-6.113.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 1 } 1 -test utf-6.112.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.113.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { testutfnext \xF2\xA0\xA0\xA0\xA0 1 } 0 -test utf-6.113.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { +test utf-6.114.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 2 } 1 -test utf-6.113.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.114.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { testutfnext \xF2\xA0\xA0\xA0\xA0 2 } 0 -test utf-6.114.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { +test utf-6.115.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 3 } 1 -test utf-6.114.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.115.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { testutfnext \xF2\xA0\xA0\xA0\xA0 3 } 0 -test utf-6.115.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { +test utf-6.116.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} { testutfnext \xF2\xA0\xA0\xA0\xA0 4 } 1 -test utf-6.115.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { +test utf-6.116.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} { testutfnext \xF2\xA0\xA0\xA0\xA0 4 } 4 -test utf-6.116 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.117 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0G 0 } 0 -test utf-6.117 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.118 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0G 1 } 1 -test utf-6.118 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.119 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0\xA0 1 } 1 -test utf-6.119 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.120 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0\xA0G 2 } 1 -test utf-6.120 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.121 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0\xA0\xA0 2 } 1 -test utf-6.121 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.122 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0\xA0\xA0G 3 } 1 -test utf-6.122 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.123 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0\xA0\xA0\xA0 3 } 1 -test utf-6.123 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.124 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0\xA0\xA0\xA0G 4 } 1 -test utf-6.124 {Tcl_UtfNext, read limits} testutfnext { +test utf-6.125 {Tcl_UtfNext, read limits} testutfnext { testutfnext \xA0\xA0\xA0\xA0\xA0 4 } 1 -test utf-6.125 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext { - testutfnext \xA0\xA0\xA0\xA0 -} 1 -test utf-6.126 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext { - testutfnext \x80\x80\x80\x80 -} 1 test utf-7.1 {Tcl_UtfPrev} testutfprev { testutfprev {} @@ -686,16 +686,16 @@ test utf-7.10.0 {Tcl_UtfPrev} {testutfprev ucs2} { test utf-7.10.1 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xF2\xA0 } 1 -test utf-7.10.1.0 {Tcl_UtfPrev} {testutfprev ucs2} { +test utf-7.10.2 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xF2\xA0\xA0\xA0 3 } 2 -test utf-7.10.1.1 {Tcl_UtfPrev} {testutfprev fullutf} { +test utf-7.10.3 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xF2\xA0\xA0\xA0 3 } 1 -test utf-7.10.2.0 {Tcl_UtfPrev} {testutfprev ucs2} { +test utf-7.10.4 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xF2\xA0\xF8\xA0 3 } 2 -test utf-7.10.2.1 {Tcl_UtfPrev} {testutfprev fullutf} { +test utf-7.10.5 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xF2\xA0\xF8\xA0 3 } 1 test utf-7.11 {Tcl_UtfPrev} testutfprev { @@ -773,16 +773,28 @@ test utf-7.17.1 {Tcl_UtfPrev} testutfprev { test utf-7.17.2 {Tcl_UtfPrev} testutfprev { testutfprev A\xD0\xA0\xA0\xF8 4 } 3 -test utf-7.18 {Tcl_UtfPrev} testutfprev { +test utf-7.18.0 {Tcl_UtfPrev} {testutfprev ucs2} { testutfprev A\xA0\xA0\xA0 } 3 -test utf-7.18.1 {Tcl_UtfPrev} testutfprev { +test utf-7.18.1 {Tcl_UtfPrev} {testutfprev fullutf} { + testutfprev A\xA0\xA0\xA0 +} 3 +test utf-7.18.2 {Tcl_UtfPrev} {testutfprev ucs2} { + testutfprev A\xA0\xA0\xA0\xA0 4 +} 3 +test utf-7.18.3 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xA0\xA0\xA0\xA0 4 } 3 -test utf-7.18.2 {Tcl_UtfPrev} testutfprev { +test utf-7.18.4 {Tcl_UtfPrev} {testutfprev ucs2} { + testutfprev A\xA0\xA0\xA0\xF8 4 +} 3 +test utf-7.18.5 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xA0\xA0\xA0\xF8 4 } 3 -test utf-7.19 {Tcl_UtfPrev} testutfprev { +test utf-7.19.0 {Tcl_UtfPrev} {testutfprev ucs2} { + testutfprev A\xF8\xA0\xA0\xA0 +} 4 +test utf-7.19.1 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xF8\xA0\xA0\xA0 } 4 test utf-7.20.0 {Tcl_UtfPrev} {testutfprev ucs2} { @@ -791,13 +803,22 @@ test utf-7.20.0 {Tcl_UtfPrev} {testutfprev ucs2} { test utf-7.20.1 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xF2\xA0\xA0\xA0 } 1 -test utf-7.21 {Tcl_UtfPrev} testutfprev { +test utf-7.21.0 {Tcl_UtfPrev} {testutfprev ucs2} { + testutfprev A\xE8\xA0\xA0\xA0 +} 4 +test utf-7.21.1 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xE8\xA0\xA0\xA0 } 4 -test utf-7.22 {Tcl_UtfPrev} testutfprev { +test utf-7.22.0 {Tcl_UtfPrev} {testutfprev ucs2} { + testutfprev A\xD0\xA0\xA0\xA0 +} 4 +test utf-7.22.1 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xD0\xA0\xA0\xA0 } 4 -test utf-7.23 {Tcl_UtfPrev} testutfprev { +test utf-7.23.0 {Tcl_UtfPrev} {testutfprev ucs2} { + testutfprev A\xA0\xA0\xA0\xA0 +} 4 +test utf-7.23.1 {Tcl_UtfPrev} {testutfprev fullutf} { testutfprev A\xA0\xA0\xA0\xA0 } 4 test utf-7.24 {Tcl_UtfPrev -- overlong sequence} testutfprev { @@ -821,7 +842,10 @@ test utf-7.28 {Tcl_UtfPrev -- overlong sequence} testutfprev { test utf-7.28.1 {Tcl_UtfPrev -- overlong sequence} testutfprev { testutfprev A\xE0\x80\x80 2 } 1 -test utf-7.29 {Tcl_UtfPrev -- overlong sequence} testutfprev { +test utf-7.29.0 {Tcl_UtfPrev -- overlong sequence} {testutfprev ucs2} { + testutfprev A\xF0\x80\x80\x80 +} 4 +test utf-7.29.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev fullutf} { testutfprev A\xF0\x80\x80\x80 } 4 test utf-7.30 {Tcl_UtfPrev -- overlong sequence} testutfprev { @@ -881,7 +905,10 @@ test utf-7.44 {Tcl_UtfPrev -- no lead byte at start} testutfprev { test utf-7.45 {Tcl_UtfPrev -- no lead byte at start} testutfprev { testutfprev \xA0\xA0\xA0 } 2 -test utf-7.46 {Tcl_UtfPrev -- no lead byte at start} testutfprev { +test utf-7.46.0 {Tcl_UtfPrev -- no lead byte at start} {testutfprev ucs2} { + testutfprev \xA0\xA0\xA0\xA0 +} 3 +test utf-7.46.1 {Tcl_UtfPrev -- no lead byte at start} {testutfprev fullutf} { testutfprev \xA0\xA0\xA0\xA0 } 3 test utf-7.47 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} testutfprev { @@ -899,31 +926,34 @@ test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { testutfprev A\xF4\x8F\xBF\xBF } 1 -test utf-7.48.1.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { +test utf-7.48.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { testutfprev A\xF4\x8F\xBF\xBF 4 } 3 -test utf-7.48.1.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { +test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { testutfprev A\xF4\x8F\xBF\xBF 4 } 1 -test utf-7.48.2.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { +test utf-7.48.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { testutfprev A\xF4\x8F\xBF\xBF 3 } 2 -test utf-7.48.2.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { +test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { testutfprev A\xF4\x8F\xBF\xBF 3 } 1 -test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { +test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { testutfprev A\xF4\x8F\xBF\xBF 2 } 1 -test utf-7.49 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { +test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} { testutfprev A\xF4\x90\x80\x80 } 4 -test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { +test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} { + testutfprev A\xF4\x90\x80\x80 +} 4 +test utf-7.49.2 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { testutfprev A\xF4\x90\x80\x80 4 } 3 -test utf-7.49.2 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { +test utf-7.49.3 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { testutfprev A\xF4\x90\x80\x80 3 } 2 -test utf-7.49.3 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { +test utf-7.49.4 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev { testutfprev A\xF4\x90\x80\x80 2 } 1 @@ -945,10 +975,10 @@ test utf-8.5 {Tcl_UniCharAtIndex: high surrogate} { test utf-8.6 {Tcl_UniCharAtIndex: low surrogate} { string index \uDC42 0 } "\uDC42" -test utf-8.7 {Tcl_UniCharAtIndex: Emoji} { +test utf-8.7 {Tcl_UniCharAtIndex: Emoji} ucs2 { string index \uD83D\uDE00 0 } "\uD83D" -test utf-8.8 {Tcl_UniCharAtIndex: Emoji} { +test utf-8.8 {Tcl_UniCharAtIndex: Emoji} ucs2 { string index \uD83D\uDE00 1 } "\uDE00" @@ -958,10 +988,10 @@ test utf-9.1 {Tcl_UtfAtIndex: index = 0} { test utf-9.2 {Tcl_UtfAtIndex: index > 0} { string range \u4E4E\u25A\xFF\u543klmnop 1 5 } "\u25A\xFF\u543kl" -test utf-9.3 {Tcl_UtfAtIndex: index = 0, Emoji} { +test utf-9.3 {Tcl_UtfAtIndex: index = 0, Emoji} ucs2 { string range \uD83D\uDE00G 0 0 } "\uD83D" -test utf-9.4 {Tcl_UtfAtIndex: index > 0, Emoji} { +test utf-9.4 {Tcl_UtfAtIndex: index > 0, Emoji} ucs2 { string range \uD83D\uDE00G 1 1 } "\uDE00" |