From 8c3efa494091e6e0001f4a708fb7568c242387b9 Mon Sep 17 00:00:00 2001 From: aycabta Date: Tue, 14 Jan 2020 15:40:03 +0900 Subject: Use Reline.encoding_system_needs if exists --- lib/irb/input-method.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/irb/input-method.rb') diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index a1777d7904..9fbbaeb0f3 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -133,6 +133,9 @@ module IRB include Readline # Creates a new input method object using Readline def initialize + if Readline.respond_to?(:encoding_system_needs) + IRB.__send__(:set_encoding, Readline.encoding_system_needs.name, override: false) + end super @line_no = 0 @@ -207,6 +210,7 @@ module IRB include Reline # Creates a new input method object using Readline def initialize + IRB.__send__(:set_encoding, Reline.encoding_system_needs.name, override: false) super @line_no = 0 -- cgit v1.2.3