Skip to content

Commit

Permalink
Fix UTF8String substring issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sodre committed Apr 12, 2021
1 parent 34fc68d commit a4adb21
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ protected Optional<Object> applyList(List<Object> argList) {

// If we get here, then all these casts should work.
String tuna = (String) argList.get(0);
int start = (Integer) argList.get(1);
int end = (Integer) argList.get(2);
int start = tuna.offsetByCodePoints(0, (Integer) argList.get(1));
int end = tuna.offsetByCodePoints(0, (Integer) argList.get(2));

// do start and end make sense?
if ( start >= end || start < 0 || end < 1 || end > tuna.length() ) {
Expand Down

0 comments on commit a4adb21

Please sign in to comment.