Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ def build_statement(code)
return Statement::EmptyInput.new
end

code.force_encoding(@context.io.encoding)
code.dup.force_encoding(@context.io.encoding)
Copy link
Copy Markdown
Member

@tompng tompng Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement has no effect. We need to change the encoding of code.
maybe code = code.dup.force_encoding(@context.io.encoding)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review and suggestion! I fixed them at
37fe153.

By the way, I met the warning in SciRuby/iruby's test code, SciRuby/iruby's code.

if (command, arg = @context.parse_command(code))
command_class = Command.load_command(command)
Statement::Command.new(code, command_class, arg)
Expand Down