summaryrefslogtreecommitdiff
path: root/lib/irb/input-method.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-01-14 15:40:03 +0900
committeraycabta <aycabta@gmail.com>2020-01-14 15:40:38 +0900
commit8c3efa494091e6e0001f4a708fb7568c242387b9 (patch)
treece5139b24592634e2870819e3a20974466afc5d4 /lib/irb/input-method.rb
parenta2638c0d87106c6ba023a321eea502f35131753e (diff)
Use Reline.encoding_system_needs if exists
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r--lib/irb/input-method.rb4
1 files changed, 4 insertions, 0 deletions
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