Skip to content

Commit 2a92931

Browse files
committed
Force the String#inspect encoding so the result may be a broken string rather than a raised exception.
1 parent ff60b1b commit 2a92931

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/ruby/core/string.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def inspect
595595
end
596596

597597
Truffle::Type.infect result, self
598-
result.encode(result_encoding, encoding)
598+
result.force_encoding(result_encoding)
599599
end
600600

601601
def inspect_char(enc, result_encoding, ascii, unicode, index, char, array)

0 commit comments

Comments
 (0)