diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-05-04 15:50:07 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-05-04 21:57:37 +1000 |
commit | a8a65e7637a4fc82777f2b0d822c902f333cd779 (patch) | |
tree | a926fe0bc6164fb0a7d7b1d3191126f51572957d /tests | |
parent | a942eef12415e0b53e04279259dd92cca4d444f0 (diff) | |
download | jimtcl-a8a65e7637a4fc82777f2b0d822c902f333cd779.zip jimtcl-a8a65e7637a4fc82777f2b0d822c902f333cd779.tar.gz jimtcl-a8a65e7637a4fc82777f2b0d822c902f333cd779.tar.bz2 |
scan: Fix a utf-8 bug for string length
The string length was being checked in chars instead of bytes
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/utf8.test | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/utf8.test b/tests/utf8.test index 7b655da..5178d8b 100644 --- a/tests/utf8.test +++ b/tests/utf8.test @@ -169,4 +169,11 @@ test utf8-9.3 {string totitle} { string totitle abc-\u01c4 } "Abc-\u01c6" +# Previously scan was using char length instead of byte length +# when iterating over the string +test utf8-10.1 {scan with utf-8} { + scan ab\u0300c %c%c%c%c a b c d + list $a $b $c $d +} {97 98 768 99} + testreport |