Skip to content

Commit

Permalink
[Truffle] Match MRI's reported character length for broken strings.
Browse files Browse the repository at this point in the history
Updated to handle a case I missed in 3f4af19.
  • Loading branch information
nirvdrum committed Jan 10, 2017
1 parent b5396d4 commit ae4655b
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -80,7 +80,7 @@ public static LeafRope create(byte[] bytes, Encoding encoding, CodeRange codeRan

codeRange = CodeRange.fromInt(StringSupport.unpackArg(packedLengthAndCodeRange));
characterLength = StringSupport.unpackResult(packedLengthAndCodeRange);
} else if (codeRange == CR_VALID) {
} else if (codeRange == CR_VALID || codeRange == CR_BROKEN) {
characterLength = strLength(encoding, bytes, 0, bytes.length);
}

Expand Down

0 comments on commit ae4655b

Please sign in to comment.