Skip to content

Commit 9e53642

Browse files
committed
Use the correct ByteList when calculating string lengths.
1 parent 34eb633 commit 9e53642

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/jruby/RubyString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ private int strLength(ByteList bytes) {
360360
}
361361

362362
private int strLength(ByteList bytes, Encoding enc) {
363-
if (isCodeRangeValid() && enc instanceof UTF8Encoding) return StringSupport.utf8Length(value);
363+
if (isCodeRangeValid() && enc instanceof UTF8Encoding) return StringSupport.utf8Length(bytes);
364364

365365
long lencr = strLengthWithCodeRange(bytes, enc);
366366
int cr = unpackArg(lencr);

0 commit comments

Comments
 (0)