Skip to content

Commit f097678

Browse files
committed
Preserve string encoding on native rope resize.
1 parent d0c93db commit f097678

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/truffleruby/core/rope/NativeRope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public NativeRope resize(FinalizationService finalizationService, int newByteLen
8080
pointer.writeBytes(0, this.pointer, 0, Math.min(byteLength(), newByteLength));
8181
pointer.writeByte(newByteLength, (byte) 0); // Like MRI
8282
pointer.enableAutorelease(finalizationService);
83-
return new NativeRope(pointer, newByteLength, ASCIIEncoding.INSTANCE, UNKNOWN_CHARACTER_LENGTH, CodeRange.CR_UNKNOWN);
83+
return new NativeRope(pointer, newByteLength, getEncoding(), UNKNOWN_CHARACTER_LENGTH, CodeRange.CR_UNKNOWN);
8484
}
8585

8686
@Override

0 commit comments

Comments
 (0)