From a8a65e7637a4fc82777f2b0d822c902f333cd779 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Mon, 4 May 2020 15:50:07 +1000 Subject: 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 --- tests/utf8.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/utf8.test') 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 -- cgit v1.1