Skip to content
Snippets Groups Projects
Commit 23eaad37 authored by Tomas Stupka's avatar Tomas Stupka
Browse files

fixed perl spliting of multibytes in strsplit

parent 36272ac0
No related branches found
No related tags found
No related merge requests found
......@@ -1267,8 +1267,8 @@ public class GrepFunctions {
lastEndIndex = endIndex;
matches.add(match);
}
if (lastEndOffset < data.length()) {
matches.add(data.substring(lastEndOffset));
if (lastEndIndex < data.length()) {
matches.add(data.substring(lastEndIndex));
}
String[] result = new String[matches.size()];
matches.toArray(result);
......
......@@ -121,5 +121,6 @@ public class TestBuiltin_strsplit extends TestBase {
assertEval("strsplit('foo bar baz', '[f z]', perl=TRUE)");
assertEval("strsplit('oo bar baz', '[f z]', perl=TRUE)");
assertEval("strsplit('foo \u1010ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄbar baz ', '[f z]', perl=TRUE)");
assertEval("strsplit('Ä Ä', '[ ]', perl=TRUE)");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment